update production docker stuff
This commit is contained in:
parent
e82de52a35
commit
94328771bf
@ -1,24 +1,24 @@
|
|||||||
# protobuf build
|
# protobuf build
|
||||||
FROM node:14.15.4-buster-slim@sha256:cbae886186467bbfd274b82a234a1cdfbbd31201c2a6ee63a6893eefcf3c6e76 as builder
|
FROM node:14-buster-slim as messages
|
||||||
WORKDIR /usr/src
|
WORKDIR /usr/src
|
||||||
COPY messages .
|
COPY messages .
|
||||||
RUN yarn install && yarn proto
|
RUN yarn install && yarn proto
|
||||||
|
|
||||||
# typescript build
|
# typescript build
|
||||||
FROM node:14.15.4-buster-slim@sha256:cbae886186467bbfd274b82a234a1cdfbbd31201c2a6ee63a6893eefcf3c6e76 as builder2
|
FROM node:14-buster-slim as builder
|
||||||
WORKDIR /usr/src
|
WORKDIR /usr/src
|
||||||
COPY back/yarn.lock back/package.json ./
|
COPY back/yarn.lock back/package.json ./
|
||||||
RUN yarn install
|
RUN yarn install
|
||||||
COPY back .
|
COPY back .
|
||||||
COPY --from=builder /usr/src/generated src/Messages/generated
|
COPY --from=messages /usr/src/generated src/Messages/generated
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
RUN yarn run tsc
|
RUN yarn run tsc
|
||||||
|
|
||||||
# final production image
|
# final production image
|
||||||
FROM node:14.15.4-buster-slim@sha256:cbae886186467bbfd274b82a234a1cdfbbd31201c2a6ee63a6893eefcf3c6e76
|
FROM node:14-buster-slim
|
||||||
WORKDIR /usr/src
|
WORKDIR /usr/src
|
||||||
COPY back/yarn.lock back/package.json ./
|
COPY back/yarn.lock back/package.json ./
|
||||||
COPY --from=builder2 /usr/src/dist /usr/src/dist
|
COPY --from=builder /usr/src/dist /usr/src/dist
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
RUN yarn install --production
|
RUN yarn install --production
|
||||||
|
|
||||||
|
@ -1,21 +1,55 @@
|
|||||||
FROM thecodingmachine/workadventure-back-base:latest as builder
|
# protobuf build
|
||||||
WORKDIR /var/www/messages
|
FROM node:14-buster-slim as messages
|
||||||
COPY --chown=docker:docker messages .
|
WORKDIR /usr/src
|
||||||
|
COPY messages .
|
||||||
RUN yarn install && yarn proto
|
RUN yarn install && yarn proto
|
||||||
|
|
||||||
# we are rebuilding on each deploy to cope with the PUSHER_URL environment URL
|
# webpack build
|
||||||
FROM thecodingmachine/nodejs:14-apache
|
FROM node:14-buster-slim as builder
|
||||||
|
WORKDIR /usr/src
|
||||||
|
COPY front/yarn.lock front/package.json ./
|
||||||
|
RUN yarn install --ignore-engines
|
||||||
|
|
||||||
COPY --chown=docker:docker front .
|
COPY front .
|
||||||
COPY --from=builder --chown=docker:docker /var/www/messages/generated /var/www/html/src/Messages/generated
|
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.
|
# 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
|
# iframe.html is only in dev mode to circumvent a limitation
|
||||||
RUN rm dist/iframe.html
|
RUN rm dist/iframe.html
|
||||||
|
RUN ./templater.sh
|
||||||
|
RUN yarn run build
|
||||||
|
|
||||||
RUN yarn install --ignore-engines
|
# final production image
|
||||||
|
FROM nginx:mainline-alpine
|
||||||
ENV NODE_ENV=production
|
COPY front/nginx-vhost.conf /etc/nginx/conf.d/default.conf
|
||||||
ENV STARTUP_COMMAND_0="./templater.sh"
|
COPY --from=builder /usr/src/dist /usr/share/nginx/html
|
||||||
ENV STARTUP_COMMAND_1="yarn run build"
|
|
||||||
ENV APACHE_DOCUMENT_ROOT=dist/
|
|
||||||
|
16
front/nginx-vhost.conf
Normal file
16
front/nginx-vhost.conf
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
server_name localhost;
|
||||||
|
|
||||||
|
access_log off;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html index.htm;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ ^/[@_]/ {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
}
|
@ -1,24 +1,24 @@
|
|||||||
# protobuf build
|
# protobuf build
|
||||||
FROM node:14.15.4-buster-slim@sha256:cbae886186467bbfd274b82a234a1cdfbbd31201c2a6ee63a6893eefcf3c6e76 as builder
|
FROM node:14-buster-slim as messages
|
||||||
WORKDIR /usr/src
|
WORKDIR /usr/src
|
||||||
COPY messages .
|
COPY messages .
|
||||||
RUN yarn install && yarn proto
|
RUN yarn install && yarn proto
|
||||||
|
|
||||||
# typescript build
|
# typescript build
|
||||||
FROM node:14.15.4-buster-slim@sha256:cbae886186467bbfd274b82a234a1cdfbbd31201c2a6ee63a6893eefcf3c6e76 as builder2
|
FROM node:14-buster-slim as builder
|
||||||
WORKDIR /usr/src
|
WORKDIR /usr/src
|
||||||
COPY pusher/yarn.lock pusher/package.json ./
|
COPY pusher/yarn.lock pusher/package.json ./
|
||||||
RUN yarn install
|
RUN yarn install
|
||||||
COPY pusher .
|
COPY pusher .
|
||||||
COPY --from=builder /usr/src/generated src/Messages/generated
|
COPY --from=messages /usr/src/generated src/Messages/generated
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
RUN yarn run tsc
|
RUN yarn run tsc
|
||||||
|
|
||||||
# final production image
|
# final production image
|
||||||
FROM node:14.15.4-buster-slim@sha256:cbae886186467bbfd274b82a234a1cdfbbd31201c2a6ee63a6893eefcf3c6e76
|
FROM node:14-buster-slim
|
||||||
WORKDIR /usr/src
|
WORKDIR /usr/src
|
||||||
COPY pusher/yarn.lock pusher/package.json ./
|
COPY pusher/yarn.lock pusher/package.json ./
|
||||||
COPY --from=builder2 /usr/src/dist /usr/src/dist
|
COPY --from=builder /usr/src/dist /usr/src/dist
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
RUN yarn install --production
|
RUN yarn install --production
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user