-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (27 loc) · 996 Bytes
/
Copy pathDockerfile
File metadata and controls
29 lines (27 loc) · 996 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
# ---- deps: install node_modules with the lockfile ----
FROM node:22-slim AS deps
RUN corepack enable pnpm
WORKDIR /app
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
COPY prisma ./prisma
RUN pnpm install --frozen-lockfile
# ---- build: prisma client + next standalone ----
FROM node:22-slim AS build
RUN corepack enable pnpm
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
ENV NEXT_TELEMETRY_DISABLED=1 CI=true SKIP_ENV_VALIDATION=1
RUN pnpm prisma generate && pnpm build
# ---- runtime ----
# Migrations run in a one-shot compose service built from the `build` stage
# (full node_modules); this stage stays minimal (standalone output only).
FROM node:22-slim AS runtime
WORKDIR /app
ENV NODE_ENV=production NEXT_TELEMETRY_DISABLED=1 PORT=3000 HOSTNAME=0.0.0.0
COPY --from=build /app/.next/standalone ./
COPY --from=build /app/.next/static ./.next/static
COPY --from=build /app/public ./public
RUN mkdir -p /data/uploads
EXPOSE 3000
CMD ["node", "server.js"]