Files
xtreamium/frontend/docker/Dockerfile
Fergal Moran f2cde38a0f Initial commit
2022-04-05 11:50:25 +01:00

22 lines
508 B
Docker

FROM node:17-buster as builder
ARG RUN_MODE=production
WORKDIR /app
COPY package.json package.json
COPY yarn.lock yarn.lock
COPY .env.${RUN_MODE} .env
RUN yarn install
COPY . .
ENV NODE_ENV=$RUN_MODE
RUN yarn build --mode $RUN_MODE
FROM nginx:alpine
ENV NODE_ENV=$RUN_MODE
RUN rm /etc/nginx/conf.d/default.conf
COPY --from=builder /app/build /usr/share/nginx/html
COPY --from=builder /app/docker/nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD [ "/bin/sh", "-c", "nginx -g 'daemon off;'" ]