-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (22 loc) · 696 Bytes
/
Copy pathDockerfile
File metadata and controls
36 lines (22 loc) · 696 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
# ---------- build ----------
FROM node:20-alpine AS builder
ARG TARGETARCH
ENV CI=true
WORKDIR /app
RUN apk add --no-cache libc6-compat
RUN npm install --global pnpm@10.14.0
RUN pnpm config set store-dir /root/.pnpm-store
COPY package.json pnpm-lock.yaml ./
RUN --mount=type=cache,id=pnpm-${TARGETARCH},target=/root/.pnpm-store \
pnpm install --frozen-lockfile --ignore-scripts
COPY . .
RUN pnpm build
# ---------- runner ----------
FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/public ./public
EXPOSE 3000
CMD ["node", "server.js"]