-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
24 lines (19 loc) · 620 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
# Base layer
FROM node:20 as base
WORKDIR /home/node/app
# Build layer (everything besides build output & node_modules can be disgarded from this)
FROM base as build
COPY yarn.lock package.json ./
COPY .git ./.git
RUN yarn
COPY . .
RUN yarn run build
# Production layer, only copy required files to run.
FROM base as production
ENV NODE_ENV=production
COPY --from=build /home/node/app/package.json ./
COPY --from=build /home/node/app/node_modules ./node_modules
COPY --from=build /home/node/app/.git ./.git
COPY --from=build /home/node/app/dist ./dist
COPY --from=build /home/node/app/data ./data
CMD ["node", "."]