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

23 lines
667 B
Docker
Raw Normal View History

2021-10-24 04:18:18 +02:00
FROM node:16.11.0 AS dependencies
WORKDIR /usr/src/app
2021-10-24 04:06:16 +02:00
COPY ./package*.json ./
2021-10-24 04:18:18 +02:00
RUN npm clean-install
FROM node:16.11.0 AS builder
WORKDIR /usr/src/app
COPY --from=dependencies /usr/src/app/node_modules ./node_modules
2021-10-24 04:06:16 +02:00
COPY ./ ./
2021-10-24 04:18:18 +02:00
RUN npx prisma generate
2021-10-24 04:06:16 +02:00
RUN npm run build
2021-10-24 04:18:18 +02:00
FROM node:16.11.0 AS runner
WORKDIR /usr/src/app
ENV NODE_ENV=production
COPY --from=builder /usr/src/app/node_modules ./node_modules
COPY --from=builder /usr/src/app/email ./email
COPY --from=builder /usr/src/app/build ./build
COPY --from=builder /usr/src/app/prisma ./prisma
COPY --from=builder /usr/src/app/uploads ./uploads
USER node
CMD npm run prisma:migrate:deploy && node build/index.js