Dockerfile 559 B

1234567891011121314151617181920212223242526272829
  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. ENV NODE_CONFIG_DIR=./dist/config
  6. RUN apt-get update
  7. RUN apt-get install nginx -y
  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