-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (25 loc) · 799 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
46
47
# Installing dependencies:
FROM node:18-alpine AS install-dependencies
WORKDIR /user/src/app
RUN npm install -g [email protected]
COPY package.json package-lock.json ./
COPY prisma ./prisma/
RUN npm install
COPY . .
# Creating a build:
FROM node:18-alpine AS create-build
WORKDIR /user/src/app
RUN npm install -g [email protected]
COPY --from=install-dependencies /user/src/app ./
RUN npm run build
USER node
# Running the application:
FROM node:18-alpine AS run
WORKDIR /user/src/app
RUN npm install -g [email protected]
COPY --from=install-dependencies /user/src/app/node_modules ./node_modules
COPY --from=create-build /user/src/app/dist ./dist
COPY --from=install-dependencies /user/src/app/prisma ./prisma
COPY package.json ./
RUN npm prune --production
CMD [ "npm", "run", "start:migrate:prod" ]