# protobuf build FROM node:14-buster-slim as messages WORKDIR /usr/src COPY messages . RUN yarn install && yarn proto # webpack build FROM node:14-buster-slim as builder WORKDIR /usr/src COPY front/yarn.lock front/package.json ./ RUN yarn install --ignore-engines COPY front . COPY --from=messages /usr/src/generated src/Messages/generated # passing arguments as enviroment ARG DEBUG_MODE ARG JITSI_URL ARG JITSI_PRIVATE_MODE ARG PUSHER_URL ARG ADMIN_URL 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 ENV NODE_ENV=production ENV DEBUG_MODE=$DEBUG_MODE ENV JITSI_URL=$JITSI_URL ENV JITSI_PRIVATE_MODE=$JITSI_PRIVATE_MODE ENV PUSHER_URL=$PUSHER_URL ENV ADMIN_URL=$ADMIN_URL ENV TURN_SERVER=$TURN_SERVER ENV TURN_USER=$TURN_USER ENV TURN_PASSWORD=$TURN_PASSWORD ENV MAX_PER_GROUP=$MAX_PER_GROUP ENV MAX_USERNAME_LENGTH=$MAX_USERNAME_LENGTH ENV START_ROOM_URL=$START_ROOM_URL ENV DISABLE_NOTIFICATIONS=$DISABLE_NOTIFICATIONS ENV SKIP_RENDER_OPTIMIZATIONS=$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 RUN ./templater.sh RUN yarn run build # 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