Dockerfile 721 B

1234567891011121314151617181920212223242526272829303132333435
  1. FROM node:16.15 AS frontend_node_modules
  2. RUN mkdir -p /opt/app
  3. WORKDIR /opt/app
  4. COPY package.json /opt/app/package.json
  5. COPY package-lock.json /opt/app/package-lock.json
  6. RUN npm install --silent
  7. FROM node:16.15 AS musare_frontend
  8. ARG FRONTEND_MODE=prod
  9. ENV FRONTEND_MODE=${FRONTEND_MODE}
  10. ENV SUPPRESS_NO_CONFIG_WARNING=1
  11. ENV NODE_CONFIG_DIR=./dist/config
  12. RUN apt-get update
  13. RUN apt-get install nginx -y
  14. RUN mkdir -p /opt/app
  15. WORKDIR /opt/app
  16. COPY . /opt/app
  17. COPY --from=frontend_node_modules /opt/app/node_modules node_modules
  18. RUN mkdir -p /run/nginx
  19. RUN bash -c '([[ "${FRONTEND_MODE}" == "dev" ]] && exit 0) || npm run prod'
  20. RUN chmod u+x entrypoint.sh
  21. ENTRYPOINT bash /opt/app/entrypoint.sh
  22. EXPOSE 80/tcp