-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (22 loc) · 738 Bytes
/
Copy pathDockerfile
File metadata and controls
28 lines (22 loc) · 738 Bytes
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
FROM node:18-alpine AS react-builder
WORKDIR /react-app
COPY true-code-task-client/package.json true-code-task-client/package-lock.json ./
RUN npm install
COPY true-code-task-client ./
RUN npm run build
FROM node:18-alpine AS nest-builder
WORKDIR /nest-app
COPY true-code-task-server/package.json true-code-task-server/package-lock.json ./
RUN npm install
COPY true-code-task-server ./
RUN npm run build
FROM node:18-alpine
WORKDIR /app
COPY --from=nest-builder /nest-app/dist ./dist
COPY --from=react-builder /react-app/dist ./dist/client
COPY --from=nest-builder /nest-app/node_modules ./node_modules
COPY --from=nest-builder /nest-app/package.json ./
ENV NODE_ENV=production
ENV PORT=3000
EXPOSE 3000
CMD ["node", "dist/main.js"]