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