-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (27 loc) · 752 Bytes
/
Dockerfile
File metadata and controls
37 lines (27 loc) · 752 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
29
30
31
32
33
34
35
36
37
FROM node:18-buster-slim AS builder
ARG app
WORKDIR /app
RUN npm i -g pnpm turbo
COPY . .
RUN turbo prune --scope=$app --docker
FROM node:18-buster-slim AS installer
ARG app
WORKDIR /app
RUN npm i -g pnpm
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
COPY --from=builder /app/out/pnpm-workspace.yaml ./pnpm-workspace.yaml
RUN pnpm i
COPY --from=builder /app/out/full/ .
RUN pnpm turbo run build --filter=$app...
FROM node:18-buster-slim AS runner
ARG app
WORKDIR /app
RUN npm i -g pnpm
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 runner
USER runner
COPY --from=installer --chown=runner:nodejs /app ./
ENV APP $app
CMD pnpm start:${APP}