-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (25 loc) · 881 Bytes
/
Dockerfile
File metadata and controls
41 lines (25 loc) · 881 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
38
39
40
41
FROM node:23-alpine3.20 AS base
ENV NODE_ENV=production NEXT_TELEMETRY_DISABLED=1
RUN npm install -g pnpm
FROM base AS builder
WORKDIR /build
RUN addgroup --system --gid 1001 builder && \
adduser --system --uid 1001 builder && \
chown -R 1001:1001 /build
USER builder
COPY --chown=1001:1001 . .
RUN pnpm i --frozen-lockfile && pnpm build
FROM base AS runner
WORKDIR /app
RUN addgroup --system --gid 1001 runner && \
adduser --system --uid 1001 runner && \
chown -R 1001:1001 /app
USER runner
COPY --from=builder --chown=1001:1001 /build/node_modules node_modules
COPY --from=builder --chown=1001:1001 /build/.next .next
COPY --from=builder --chown=1001:1001 /build/public public
COPY --from=builder --chown=1001:1001 /build/package.json .
COPY --from=builder --chown=1001:1001 /build/next.config.ts .
ENV PORT=8080
EXPOSE 8080
CMD ["pnpm", "start"]