Dockerfile 708 B

1234567891011121314151617181920212223242526272829303132
  1. FROM node:18 AS backend_node_modules
  2. RUN mkdir -p /opt/app
  3. WORKDIR /opt/app
  4. COPY backend/package.json backend/package-lock.json /opt/app/
  5. RUN npm install --silent
  6. FROM node:18 AS musare_backend
  7. ARG CONTAINER_MODE=production
  8. ARG BACKEND_MODE=production
  9. ENV CONTAINER_MODE=${CONTAINER_MODE}
  10. ENV BACKEND_MODE=${BACKEND_MODE}
  11. RUN mkdir -p /opt/.git /opt/types /opt/app
  12. WORKDIR /opt/app
  13. COPY .git /opt/.git
  14. COPY types /opt/types
  15. COPY backend /opt/app
  16. COPY --from=backend_node_modules /opt/app/node_modules node_modules
  17. RUN bash -c '([[ "${BACKEND_MODE}" == "development" ]] && exit 0) || npm run build'
  18. RUN chmod u+x entrypoint.sh
  19. ENTRYPOINT bash /opt/app/entrypoint.sh
  20. EXPOSE 8080/tcp
  21. EXPOSE 8080/udp