-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
31 lines (28 loc) · 853 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM node:17-alpine AS dev-deps
RUN mkdir /app && chown node:node /app
WORKDIR /app
USER node
COPY --chown=node:node package.json yarn.lock ./
RUN yarn install
FROM node:17-alpine AS production-deps
RUN mkdir /app && chown node:node /app
WORKDIR /app
USER node
COPY --chown=node:node package.json yarn.lock ./
COPY --chown=node:node ./prisma ./prisma
RUN yarn install --production
RUN yarn generate
FROM dev-deps AS compile
WORKDIR /app
USER node
COPY --chown=node:node . ./
RUN yarn generate
RUN yarn build
FROM node:17-alpine AS final
RUN mkdir /app && chown node:node /app
WORKDIR /app
USER node
COPY --chown=node:node --from=production-deps /app/node_modules ./node_modules
#COPY --chown=node:node --from=compile /app/node_modules/@prisma ./node_modules/@prisma
COPY --chown=node:node --from=compile /app/dist ./dist
CMD ["node", "dist/index.js"]