Dockerfile 657 B

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