partey_workadventure/front/Dockerfile

73 lines
2.1 KiB
Docker
Raw Normal View History

2021-08-20 12:30:33 +02:00
# protobuf build
2022-01-27 13:27:09 +01:00
FROM node:14.18.2-buster-slim@sha256:20bedf0c09de887379e59a41c04284974f5fb529cf0e13aab613473ce298da3d as messages
2021-08-20 12:30:33 +02:00
WORKDIR /usr/src
COPY messages .
RUN yarn install && yarn ts-proto
2022-02-20 13:28:10 +01:00
2021-08-20 12:30:33 +02:00
# webpack build
2022-01-27 13:27:09 +01:00
FROM node:14.18.2-buster-slim@sha256:20bedf0c09de887379e59a41c04284974f5fb529cf0e13aab613473ce298da3d as builder
2021-08-20 12:30:33 +02:00
WORKDIR /usr/src
COPY front/yarn.lock front/package.json ./
RUN yarn install --ignore-engines
2020-04-09 11:00:30 +02:00
2022-01-04 13:55:34 +01:00
COPY front .
2022-01-04 13:59:09 +01:00
COPY --from=messages /usr/src/ts-proto-generated/protos src/Messages/ts-proto-generated
RUN sed -i 's/import { Observable } from "rxjs";/import type { Observable } from "rxjs";/g' src/Messages/ts-proto-generated/messages.ts
COPY --from=messages /usr/src/JsonMessages src/Messages/JsonMessages
2021-08-20 12:30:33 +02:00
2022-02-20 13:28:10 +01:00
RUN DEBIAN_FRONTEND=noninteractive apt-get update \
&& apt-get install -y \
gettext-base
RUN rm dist/iframe.html
RUN yarn run typesafe-i18n
RUN yarn run build
RUN ./templater.sh
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 ICON_URL
2021-08-20 12:30:33 +02:00
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
2021-09-28 09:51:53 +02:00
ARG PROFILE_URL
2021-08-20 12:30:33 +02:00
ARG START_ROOM_URL
ARG DISABLE_NOTIFICATIONS
ARG SKIP_RENDER_OPTIMIZATIONS
2021-11-16 11:06:20 +01:00
ARG OPID_LOGIN_SCREEN_PROVIDER
2021-08-20 12:30:33 +02:00
2022-02-20 13:28:10 +01:00
ENV DEBUG_MODE=$DEBUG_MODE
ENV JITSI_URL=$JITSI_URL
ENV JITSI_PRIVATE_MODE=$JITSI_PRIVATE_MODE
ENV PUSHER_URL=$PUSHER_URL
ENV ICON_URL=$ICON_URL
ENV ADMIN_URL=$ADMIN_URL
ENV STUN_SERVER=$STUN_SERVER
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 PROFILE_URL=$PROFILE_URL
ENV START_ROOM_URL=$START_ROOM_URL
ENV DISABLE_NOTIFICATIONS=$DISABLE_NOTIFICATIONS
ENV SKIP_RENDER_OPTIMIZATIONS=$SKIP_RENDER_OPTIMIZATIONS
ENV OPID_LOGIN_SCREEN_PROVIDER=$OPID_LOGIN_SCREEN_PROVIDER
RUN envsubst < dist/env-config.template.js > dist/env-config.js
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
2022-02-20 13:28:10 +01:00
RUN cat /usr/share/nginx/html/env-config.js