-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (21 loc) · 781 Bytes
/
Dockerfile
File metadata and controls
30 lines (21 loc) · 781 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
FROM node:24-bookworm-slim AS base
FROM base AS builder
WORKDIR /app
RUN npm i -g turbo@2.4.4
COPY . .
RUN npx turbo prune api --docker
FROM base AS installer
WORKDIR /app
RUN apt-get update && apt-get install -y build-essential python3 --no-install-recommends && rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/out/json/ .
RUN npm install
COPY --from=builder /app/out/full/ .
RUN npm run build
FROM node:24-bookworm-slim AS runner
WORKDIR /app
RUN apt-get update && apt-get install -y openssl --no-install-recommends && rm -rf /var/lib/apt/lists/*
RUN addgroup --system --gid 1001 apiuser
RUN adduser --system --uid 1001 apiuser
COPY --from=installer --chown=apiuser:apiuser /app .
USER apiuser
CMD npm run prisma:migrate:production --workspace api && npm run start