Dockerfile 592 B

12345678910111213141516171819202122232425262728293031
  1. FROM node:16.15 AS musare_frontend
  2. ARG FRONTEND_MODE=prod
  3. ENV FRONTEND_MODE=${FRONTEND_MODE}
  4. ENV SUPPRESS_NO_CONFIG_WARNING=1
  5. RUN apt-get update
  6. RUN apt-get install nginx -y
  7. RUN npm install -g webpack@5.73.0 webpack-cli@4.9.2
  8. RUN mkdir -p /opt/app
  9. WORKDIR /opt/app
  10. COPY package.json /opt/app/package.json
  11. COPY package-lock.json /opt/app/package-lock.json
  12. RUN npm install
  13. COPY . /opt/app
  14. RUN mkdir -p /run/nginx
  15. RUN bash -c '[[ "${FRONTEND_MODE}" = "prod" ]] && npm run prod' || exit 0
  16. RUN chmod u+x entrypoint.sh
  17. ENTRYPOINT bash /opt/app/entrypoint.sh
  18. EXPOSE 80/tcp
  19. EXPOSE 80/udp