Dockerfile 525 B

12345678910111213141516171819202122232425262728
  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 mkdir -p /opt/app
  8. WORKDIR /opt/app
  9. COPY package.json /opt/app/package.json
  10. COPY package-lock.json /opt/app/package-lock.json
  11. RUN npm install
  12. COPY . /opt/app
  13. RUN mkdir -p /run/nginx
  14. RUN bash -c '[[ "${FRONTEND_MODE}" = "prod" ]] && npm run prod' || exit 0
  15. RUN chmod u+x entrypoint.sh
  16. ENTRYPOINT bash /opt/app/entrypoint.sh
  17. EXPOSE 80/tcp