-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (28 loc) · 905 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
FROM node:16-bullseye-slim as base
ENV NODE_ENV=production
RUN apt-get update && apt-get install -y openssl python3 cmake g++
FROM base as deps
WORKDIR /service
ADD package.json yarn.lock ./
RUN yarn install --production=false
FROM base as production-deps
WORKDIR /service
COPY --from=deps /service/node_modules /service/node_modules
ADD package.json yarn.lock ./
RUN yarn install --production --ignore-scripts
FROM base as build
WORKDIR /service
COPY --from=deps /service/node_modules /service/node_modules
ADD prisma ./prisma
ADD . .
RUN yarn run prisma:generate
RUN yarn run build
FROM base
WORKDIR /service
ADD . .
COPY --from=production-deps /service/node_modules /service/node_modules
COPY --from=build /service/node_modules/.prisma /service/node_modules/.prisma
COPY --from=build /service/build /service/build
ADD entrypoint.sh /
RUN chmod +x /entrypoint.sh
CMD ["/entrypoint.sh"]