Dockerfile 586 B

1234567891011121314151617181920212223242526
  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
  6. FROM node:18 AS musare_backend
  7. ARG CONTAINER_MODE=production
  8. ENV CONTAINER_MODE=${CONTAINER_MODE}
  9. RUN mkdir -p /opt/.git /opt/types /opt/app
  10. WORKDIR /opt/app
  11. COPY .git /opt/.git
  12. COPY types /opt/types
  13. COPY backend /opt/app
  14. COPY --from=backend_node_modules /opt/app/node_modules node_modules
  15. ENTRYPOINT bash -c '([[ "${CONTAINER_MODE}" == "development" ]] && npm install); npm run docker:dev'
  16. EXPOSE 8080/tcp
  17. EXPOSE 8080/udp