-
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into tandem-fsl2
- Loading branch information
Showing
153 changed files
with
6,246 additions
and
5,645 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
|
||
Dockerfile | ||
|
||
Dockerfile.dev | ||
|
||
docker-compose.yaml | ||
|
||
.env | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,91 @@ | ||
FROM ubuntu:18.04 | ||
FROM node:18.17.1-alpine as base | ||
WORKDIR /app | ||
RUN mkdir -p dist node_modules .yarn-cache && chown -R node:node . | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV NODE_VERSION "v16.14.2" | ||
|
||
# Lots of packages. Some dependencies and stuff for GUI. | ||
RUN apt-get -qq -y update && \ | ||
apt-get -qq -y install build-essential git curl libusb-1.0 libavutil-dev libxss1 \ | ||
libsecret-1-dev libudev-dev libgtk-3-0 libcanberra-gtk3-module packagekit-gtk3-module \ | ||
chromium-browser | ||
|
||
RUN useradd -s /bin/bash node && mkdir -p /home/node/.config \ | ||
&& chown -R node:node /home/node | ||
|
||
# Yarn | ||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - | ||
|
||
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list | ||
RUN apt-get -qq -y update && apt-get -qq -y install yarn | ||
|
||
# Node | ||
RUN curl -O https://nodejs.org/download/release/$NODE_VERSION/node-$NODE_VERSION-linux-x64.tar.gz \ | ||
&& tar -xzf node-$NODE_VERSION-linux-x64.tar.gz -C /usr/local/bin | ||
|
||
ENV PATH=/usr/local/bin/node-$NODE_VERSION-linux-x64/bin:${PATH} | ||
|
||
RUN chown -R node:$(id -gn node) /home/node/.config | ||
|
||
WORKDIR /home/node | ||
|
||
RUN mkdir uploader | ||
|
||
ENV NODE_ENV "development" | ||
|
||
WORKDIR /home/node/uploader/ | ||
|
||
COPY entrypoint.sh entrypoint.sh | ||
FROM base as build | ||
ARG API_URL | ||
ARG UPLOAD_URL | ||
ARG DATA_URL | ||
ARG BLIP_URL | ||
ARG REALM_HOST | ||
ARG PORT=3001 | ||
ARG SERVICE_NAME=uploader | ||
ARG ROLLBAR_POST_SERVER_TOKEN | ||
ARG I18N_ENABLED=false | ||
ARG RX_ENABLED=false | ||
ARG PENDO_ENABLED=true | ||
ARG TRAVIS_COMMIT | ||
# Set ENV from ARGs | ||
ENV \ | ||
API_URL=$API_URL \ | ||
UPLOAD_URL=$UPLOAD_URL \ | ||
DATA_URL=$DATA_URL \ | ||
BLIP_URL=$BLIP_URL \ | ||
REALM_HOST=$REALM_HOST \ | ||
PORT=$PORT \ | ||
SERVICE_NAME=$SERVICE_NAME \ | ||
ROLLBAR_POST_TOKEN=$ROLLBAR_POST_SERVER_TOKEN \ | ||
I18N_ENABLED=$I18N_ENABLED \ | ||
RX_ENABLED=$RX_ENABLED \ | ||
PENDO_ENABLED=$PENDO_ENABLED \ | ||
TRAVIS_COMMIT=$TRAVIS_COMMIT \ | ||
NODE_ENV=development | ||
|
||
# Install dependancies | ||
RUN \ | ||
echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \ | ||
&& echo "http://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories \ | ||
&& echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \ | ||
&& apk --no-cache update \ | ||
&& apk --no-cache upgrade \ | ||
&& apk add --no-cache --virtual .build-deps alpine-sdk python3 linux-headers eudev-dev ffmpeg-dev \ | ||
&& rm -rf /var/cache/apk/* /tmp/* | ||
USER node | ||
RUN mkdir -p /home/node/.yarn-cache /home/node/.cache/yarn | ||
COPY --chown=node:node package.json yarn.lock ./ | ||
RUN --mount=type=cache,target=/home/node/.yarn-cache,id=yarn,uid=1000,gid=1000 yarn install --ignore-scripts --cache-folder /home/node/.yarn-cache | ||
# Copy source files, and possibily invalidate so we have to rebuild | ||
COPY --chown=node:node . . | ||
RUN npm run build-web | ||
USER root | ||
RUN apk del .build-deps | ||
|
||
ENTRYPOINT ["/bin/bash", "entrypoint.sh"] | ||
FROM base as production | ||
ARG API_URL | ||
ARG UPLOAD_URL | ||
ARG DATA_URL | ||
ARG BLIP_URL | ||
ARG REALM_HOST | ||
ARG PORT=3001 | ||
ARG SERVICE_NAME=uploader | ||
ARG ROLLBAR_POST_SERVER_TOKEN | ||
ARG I18N_ENABLED=false | ||
ARG RX_ENABLED=false | ||
ARG PENDO_ENABLED=true | ||
ARG TRAVIS_COMMIT | ||
# Set ENV from ARGs | ||
ENV \ | ||
API_URL=$API_URL \ | ||
UPLOAD_URL=$UPLOAD_URL \ | ||
DATA_URL=$DATA_URL \ | ||
BLIP_URL=$BLIP_URL \ | ||
REALM_HOST=$REALM_HOST \ | ||
PORT=$PORT \ | ||
SERVICE_NAME=$SERVICE_NAME \ | ||
ROLLBAR_POST_TOKEN=$ROLLBAR_POST_SERVER_TOKEN \ | ||
I18N_ENABLED=$I18N_ENABLED \ | ||
RX_ENABLED=$RX_ENABLED \ | ||
PENDO_ENABLED=$PENDO_ENABLED \ | ||
TRAVIS_COMMIT=$TRAVIS_COMMIT \ | ||
NODE_ENV=production | ||
# Only install dependancies needed for the production server | ||
USER node | ||
RUN yarn add express@4.16.3 helmet@7.0.0 body-parser@1.18.3 | ||
# Copy only files needed to run the server | ||
COPY --from=build /app/dist dist | ||
COPY --from=build \ | ||
/app/config.server.js \ | ||
/app/package.json \ | ||
/app/server.js \ | ||
./ | ||
CMD ["node", "server.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
FROM ubuntu:18.04 | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV NODE_VERSION "v12.13.0" | ||
|
||
# Lots of packages. Some dependencies and stuff for GUI. | ||
RUN apt-get -qq -y update && \ | ||
apt-get -qq -y install build-essential git curl libusb-1.0 libavutil-dev libxss1 \ | ||
libsecret-1-dev libudev-dev libgtk-3-0 libcanberra-gtk3-module packagekit-gtk3-module \ | ||
chromium-browser | ||
|
||
RUN useradd -s /bin/bash node && mkdir -p /home/node/.config \ | ||
&& chown -R node:node /home/node | ||
|
||
# Yarn | ||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - | ||
|
||
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list | ||
RUN apt-get -qq -y update && apt-get -qq -y install yarn | ||
|
||
# Node | ||
RUN curl -O https://nodejs.org/download/release/$NODE_VERSION/node-$NODE_VERSION-linux-x64.tar.gz \ | ||
&& tar -xzf node-$NODE_VERSION-linux-x64.tar.gz -C /usr/local/bin | ||
|
||
ENV PATH=/usr/local/bin/node-$NODE_VERSION-linux-x64/bin:${PATH} | ||
|
||
RUN chown -R node:$(id -gn node) /home/node/.config | ||
|
||
WORKDIR /home/node | ||
|
||
RUN mkdir uploader | ||
|
||
ENV NODE_ENV "development" | ||
|
||
WORKDIR /home/node/uploader/ | ||
|
||
COPY entrypoint.sh entrypoint.sh | ||
|
||
USER node | ||
|
||
ENTRYPOINT ["/bin/bash", "entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.