-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (26 loc) · 1.02 KB
/
Dockerfile
File metadata and controls
33 lines (26 loc) · 1.02 KB
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
29
30
31
32
33
# This Dockerfile is a multistage build.
# This Dockerfile is composed of multiple instructions to potentially
# improve the Docker cache. Each step can be cached as long as source files
# remains the same.
# Building the app with the monorepo
FROM --platform=linux/amd64 node:20-alpine AS builder
WORKDIR /app
# Copy the source files.
COPY tsconfig.json tsconfig.json
COPY package.json package.json
COPY yarn.lock yarn.lock
COPY src src
COPY backoffice backoffice
RUN yarn --cwd backoffice install --immutable
RUN yarn install --immutable
# Running the app with only the API
FROM --platform=linux/amd64 node:20-alpine AS runner
WORKDIR /app
# Copy Nest.js API built code.
COPY --from=builder /app/dist dist
COPY --from=builder /app/package.json package.json
COPY --from=builder /app/yarn.lock yarn.lock
COPY --from=builder /app/tsconfig.json tsconfig.json
COPY --from=builder /app/backoffice/dist backoffice/dist
RUN yarn install --immutable --production
CMD ["yarn", "start"]