partey_workadventure/front/Dockerfile

58 lines
1.5 KiB
Docker
Raw Normal View History

2021-08-20 12:30:33 +02:00
# protobuf build
FROM node:14-buster-slim as messages
WORKDIR /usr/src
COPY messages .
RUN yarn install && yarn proto
2021-08-20 12:30:33 +02:00
# webpack build
FROM node:14-buster-slim as builder
WORKDIR /usr/src
COPY front/yarn.lock front/package.json ./
RUN yarn install --ignore-engines
2020-04-09 11:00:30 +02:00
2021-08-20 12:30:33 +02:00
COPY front .
COPY --from=messages /usr/src/generated src/Messages/generated
2021-08-23 09:07:07 +02:00
# passing arguments as environment
2021-08-20 12:30:33 +02:00
ARG DEBUG_MODE
ARG JITSI_URL
ARG JITSI_PRIVATE_MODE
ARG PUSHER_URL
ARG ADMIN_URL
2021-08-20 12:49:12 +02:00
ARG STUN_SERVER
2021-08-20 12:30:33 +02:00
ARG TURN_SERVER
ARG TURN_USER
ARG TURN_PASSWORD
ARG MAX_PER_GROUP
ARG MAX_USERNAME_LENGTH
ARG START_ROOM_URL
ARG DISABLE_NOTIFICATIONS
ARG SKIP_RENDER_OPTIMIZATIONS
# Removing the iframe.html file from the final image as this adds a XSS attack.
# iframe.html is only in dev mode to circumvent a limitation
RUN rm dist/iframe.html
2021-08-23 09:07:07 +02:00
ENV NODE_ENV=production
2021-08-20 12:30:33 +02:00
RUN ./templater.sh
2021-08-20 12:49:12 +02:00
RUN \
DEBUG_MODE=$DEBUG_MODE \
JITSI_URL=$JITSI_URL \
JITSI_PRIVATE_MODE=$JITSI_PRIVATE_MODE \
PUSHER_URL=$PUSHER_URL \
ADMIN_URL=$ADMIN_URL \
STUN_SERVER=$STUN_SERVER \
TURN_SERVER=$TURN_SERVER \
TURN_USER=$TURN_USER \
TURN_PASSWORD=$TURN_PASSWORD \
MAX_PER_GROUP=$MAX_PER_GROUP \
MAX_USERNAME_LENGTH=$MAX_USERNAME_LENGTH \
START_ROOM_URL=$START_ROOM_URL \
DISABLE_NOTIFICATIONS=$DISABLE_NOTIFICATIONS \
SKIP_RENDER_OPTIMIZATIONS=$SKIP_RENDER_OPTIMIZATIONS \
yarn run build
2021-08-20 12:30:33 +02:00
# final production image
FROM nginx:mainline-alpine
COPY front/nginx-vhost.conf /etc/nginx/conf.d/default.conf
COPY --from=builder /usr/src/dist /usr/share/nginx/html