Dockerfile 520 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. FROM node:20.12.2 AS builder
  2. WORKDIR /usr/src/app
  3. # # Install pnpm
  4. RUN npm i -g pnpm
  5. COPY .env .
  6. COPY pnpm-lock.yaml .
  7. RUN pnpm fetch
  8. ENV APP_PORT=${PORT}
  9. ENV DB_URL=${DATABASE_URL}
  10. # # PNPM package install
  11. COPY ./packages/hoppscotch-backend .
  12. RUN pnpm i --filter hoppscotch-backend
  13. # Prisma bits
  14. RUN pnpm exec prisma generate
  15. FROM builder AS dev
  16. ENV PRODUCTION="false"
  17. CMD ["pnpm", "run", "start:dev"]
  18. EXPOSE 3170
  19. FROM builder AS prod
  20. ENV PRODUCTION="true"
  21. CMD ["pnpm", "run", "start:prod"]
  22. EXPOSE 3170