2021-01-08 00:20:27 +01:00
|
|
|
# protobuf build
|
|
|
|
FROM node:14-buster-slim as builder
|
|
|
|
WORKDIR /usr/src
|
|
|
|
COPY messages .
|
2020-09-18 18:00:03 +02:00
|
|
|
RUN yarn install && yarn proto
|
|
|
|
|
2020-04-09 11:00:30 +02:00
|
|
|
|
2021-01-08 00:20:27 +01:00
|
|
|
# webpack build
|
|
|
|
FROM node:14-buster-slim as builder2
|
|
|
|
WORKDIR /usr/src
|
|
|
|
COPY front/yarn.lock front/package.json ./
|
|
|
|
RUN yarn install
|
|
|
|
|
|
|
|
COPY front .
|
|
|
|
COPY --from=builder /usr/src/generated src/Messages/generated
|
|
|
|
ENV NODE_ENV=production
|
2021-03-07 21:02:38 +01:00
|
|
|
|
|
|
|
# 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-01-08 00:20:27 +01:00
|
|
|
ARG PUSHER_URL=/pusher
|
|
|
|
ARG ADMIN_URL=/admin
|
|
|
|
ARG MAPS_URL=/maps
|
|
|
|
ARG UPLOADER_URL=/uploader
|
|
|
|
ARG START_ROOM_URL
|
|
|
|
ARG JITSI_PRIVATE_MODE
|
|
|
|
ARG JITSI_URL
|
|
|
|
ARG STUN_SERVER
|
|
|
|
ARG TURN_SERVER
|
|
|
|
ARG TURN_USER
|
|
|
|
ARG TURN_PASSWORD
|
2021-05-17 12:01:51 +02:00
|
|
|
ARG MAX_USERNAME_LENGTH
|
|
|
|
ARG MAX_PER_GROUP
|
2020-04-09 11:00:30 +02:00
|
|
|
|
2021-01-08 00:20:27 +01:00
|
|
|
COPY front .
|
|
|
|
COPY --from=builder /usr/src/generated src/Messages/generated
|
2020-04-09 11:00:30 +02:00
|
|
|
ENV NODE_ENV=production
|
2021-01-08 00:20:27 +01:00
|
|
|
|
|
|
|
ARG ADMIN_URL=admin.$BASE_DOMAIN
|
|
|
|
ARG API_URL=pusher.$BASE_DOMAIN
|
|
|
|
ARG BASE_DOMAIN=workadventure.localhost
|
|
|
|
ARG JITSI_PRIVATE_MODE
|
|
|
|
ARG JITSI_URL
|
|
|
|
ARG START_ROOM_URL
|
|
|
|
ARG STUN_SERVER
|
|
|
|
ARG TURN_PASSWORD
|
|
|
|
ARG TURN_SERVER
|
|
|
|
ARG TURN_USER
|
|
|
|
ARG UPLOADER_URL=uploader.$BASE_DOMAIN
|
|
|
|
|
|
|
|
RUN ./templater.sh
|
|
|
|
RUN API_URL=$API_URL UPLOADER_URL=$UPLOADER_URL ADMIN_URL=$ADMIN_URL START_ROOM_URL=$START_ROOM_URL \
|
|
|
|
JITSI_URL=$JITSI_URL JITSI_PRIVATE_MODE=$JITSI_PRIVATE_MODE \
|
2021-05-17 12:01:51 +02:00
|
|
|
STUN_SERVER=$STUN_SERVER TURN_SERVER=$TURN_SERVER TURN_USER=$TURN_USER \
|
|
|
|
TURN_PASSWORD=$TURN_PASSWORD MAX_USERNAME_LENGTH=$MAX_USERNAME_LENGTH MAX_PER_GROUP=$MAX_PER_GROUP \
|
2021-01-08 00:20:27 +01:00
|
|
|
yarn run build
|
|
|
|
|
|
|
|
# final production image
|
|
|
|
FROM nginx:mainline-alpine
|
|
|
|
COPY front/nginx-vhost.conf /etc/nginx/conf.d/default.conf
|
|
|
|
COPY --from=builder2 /usr/src/dist /usr/share/nginx/html
|