File tree Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Expand file tree Collapse file tree 2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM node:20-alpine AS builder
2
+ RUN apk add --no-cache openssl
3
+ WORKDIR /usr/src/app
4
+
5
+ COPY package*.json ./
6
+ COPY prisma ./prisma/
7
+
8
+ RUN npm ci
9
+
10
+ COPY . .
11
+ RUN npx prisma generate
12
+ RUN npm run build
13
+
14
+ FROM node:20-alpine AS runner
15
+ WORKDIR /usr/src/app
16
+
17
+ RUN apk add --no-cache openssl && \
18
+ addgroup --system --gid 1001 nodejs && \
19
+ adduser --system --uid 1001 nodejs
20
+
21
+ COPY --from=builder --chown=nodejs:nodejs /usr/src/app/package.json ./
22
+ COPY --from=builder --chown=nodejs:nodejs /usr/src/app/node_modules ./node_modules
23
+ COPY --from=builder --chown=nodejs:nodejs /usr/src/app/dist ./dist
24
+ COPY --from=builder --chown=nodejs:nodejs /usr/src/app/prisma ./prisma
25
+
26
+ USER nodejs
27
+
28
+ RUN npx prisma generate
29
+ CMD [ "node" , "dist/main.js" ]
Original file line number Diff line number Diff line change
1
+ services :
2
+ backend :
3
+ build :
4
+ context : .
5
+ dockerfile : Dockerfile
6
+ ports :
7
+ - " 3000:3000"
8
+ env_file :
9
+ - .env
10
+ restart : always
11
+
You can’t perform that action at this time.
0 commit comments