This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
api/Dockerfile

22 lines
648 B
Docker
Raw Permalink Normal View History

2023-07-02 18:45:54 +02:00
FROM node:18.16.1 AS dependencies
2021-10-24 04:18:18 +02:00
WORKDIR /usr/src/app
2021-10-24 04:06:16 +02:00
COPY ./package*.json ./
RUN npm install
2021-10-24 04:18:18 +02:00
2023-07-02 18:45:54 +02:00
FROM node:18.16.1 AS builder
2021-10-24 04:18:18 +02:00
WORKDIR /usr/src/app
COPY --from=dependencies /usr/src/app/node_modules ./node_modules
2021-10-24 04:06:16 +02:00
COPY ./ ./
RUN npm run prisma:generate && npm run build
2021-10-24 04:06:16 +02:00
2023-07-02 18:45:54 +02:00
FROM node:18.16.1 AS runner
2021-10-24 04:18:18 +02:00
WORKDIR /usr/src/app
ENV NODE_ENV=production
COPY --from=builder /usr/src/app/node_modules ./node_modules
COPY --from=builder /usr/src/app/package.json ./package.json
2021-10-24 04:18:18 +02:00
COPY --from=builder /usr/src/app/email ./email
COPY --from=builder /usr/src/app/build ./build
COPY --from=builder /usr/src/app/prisma ./prisma
USER node
2022-08-30 17:57:29 +02:00
CMD ["node", "build/index.js"]