Dockerfile
561 Bytes
FROM node:14-alpine as build
WORKDIR /usr
COPY common ./common
COPY web ./web
WORKDIR /usr/common
RUN yarn install
WORKDIR /usr/web
RUN yarn install
RUN yarn build
FROM nginx:latest
ARG HOST
ENV HOST ${HOST}
ARG SSL_CERT
ENV SSL_CERT ${SSL_CERT}
ARG SSL_KEY
ENV SSL_KEY ${SSL_KEY}
ARG SSL_CA
ENV SSL_CA ${SSL_CA}
COPY web/default.conf /etc/nginx/conf.d/default_temp
RUN envsubst < /etc/nginx/conf.d/default_temp > /etc/nginx/conf.d/default.conf
COPY --from=build /usr/web/build /usr/web/build
EXPOSE 443
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]