Dockerfile 555 B

12345678910111213141516171819202122232425
  1. FROM node:16.15 AS backend_node_modules
  2. RUN mkdir -p /opt/app
  3. WORKDIR /opt/app
  4. COPY package.json /opt/app/package.json
  5. COPY package-lock.json /opt/app/package-lock.json
  6. RUN npm install --silent
  7. FROM node:16.15 AS musare_backend
  8. ARG CONTAINER_MODE=prod
  9. ENV CONTAINER_MODE=${CONTAINER_MODE}
  10. RUN mkdir -p /opt/app
  11. WORKDIR /opt/app
  12. COPY . /opt/app
  13. COPY --from=backend_node_modules /opt/app/node_modules node_modules
  14. ENTRYPOINT bash -c '([[ "${CONTAINER_MODE}" == "dev" ]] && npm install --silent); npm run docker:dev'
  15. EXPOSE 8080/tcp
  16. EXPOSE 8080/udp