-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
42 lines (22 loc) · 885 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
FROM node:18-buster as builder
RUN mkdir app
WORKDIR /app
COPY . .
RUN yarn install
RUN npx prisma generate --schema=./packages/database/prisma/schema.prisma
WORKDIR /app/apps/core
RUN yarn build:prod
FROM node:18-alpine as schema-builder
WORKDIR /app
COPY --chown=node:node --from=builder /app/packages/database/prisma/schema.prisma ./app/prisma/
# Generate the Prisma query engine for Node Alpine
RUN npx prisma generate --schema=./app/prisma/schema.prisma
FROM node:18-alpine AS snipcode
ENV NODE_ENV=production
WORKDIR /app
COPY --chown=node:node --from=builder /app/apps/core/build/index.js ./
COPY --chown=node:node --from=schema-builder /app/node_modules/.prisma/client/schema.prisma ./
COPY --chown=node:node --from=schema-builder /app/node_modules/.prisma/client/libquery_engine-linux-musl.so.node ./
RUN yarn init -y
EXPOSE 7501
CMD ["node", "index.js"]