File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 1- FROM node:20 as builder
1+ FROM node:20-alpine as builder
22
33# Create app dir
44
@@ -7,19 +7,21 @@ WORKDIR /app
77COPY package*.json ./
88COPY prisma ./prisma/
99
10- RUN npm install
10+ RUN npm ci && npm cache clean --force
1111
1212COPY . .
1313
1414RUN npm run build
1515
16- FROM node:20
16+ FROM node:20-alpine
1717
1818WORKDIR /app
1919
20- COPY --from=builder /app/node_modules ./node_modules
21- COPY --from=builder /app/package*.json ./
22- COPY --from=builder /app/dist ./dist
20+ COPY --from=builder --chown=node:node /app/node_modules ./node_modules
21+ COPY --from=builder --chown=node:node /app/package*.json ./
22+ COPY --from=builder --chown=node:node /app/dist ./dist
23+
24+ USER node
2325
2426EXPOSE 3000
2527CMD ["npm" , "run" ,"start:prod" ]
You can’t perform that action at this time.
0 commit comments