We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1241623 commit 5ccc81fCopy full SHA for 5ccc81f
Dockerfile
@@ -1,4 +1,4 @@
1
-FROM node:20-alpine
+FROM node:20-alpine AS builder
2
3
WORKDIR /app
4
@@ -11,6 +11,13 @@ COPY . .
11
12
RUN yarn build
13
14
-EXPOSE 8000
+FROM node:20-alpine AS runner
15
16
-CMD [ "yarn", "start" ]
+WORKDIR /app
17
+COPY --from=builder --chown=node:node /app/dist ./dist
18
+COPY --from=builder --chown=node:node /app/node_modules ./node_modules
19
+
20
+ENV NODE_ENV=production
21
+USER node
22
23
+CMD ["node", "dist/main.js"]
docker-compose.yml
@@ -11,7 +11,6 @@ services:
volumes:
- .:/app
- node_modules:/app/node_modules
- command: yarn start
postgres:
image: postgres
0 commit comments