Dockerfile 559 B

123456789101112131415161718192021222324252627282930
  1. FROM node:16.15 AS musare_frontend
  2. ARG FRONTEND_MODE=prod
  3. ENV FRONTEND_MODE=${FRONTEND_MODE}
  4. RUN apt-get update
  5. RUN apt-get install nginx -y
  6. RUN npm install -g webpack@5.72.0 webpack-cli@4.9.2
  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
  18. EXPOSE 80/udp