Skip to content

Commit 8a07638

Browse files
committed
fix: dockerfile
1 parent c2a9814 commit 8a07638

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# ---- build ----
88
FROM node:20-alpine AS builder
99
WORKDIR /app
10+
ENV NEXT_TELEMETRY_DISABLED=1
1011
COPY --from=deps /app/node_modules ./node_modules
1112
COPY . .
1213
RUN npm run build
@@ -15,15 +16,14 @@
1516
FROM node:20-alpine AS runner
1617
WORKDIR /app
1718
ENV NODE_ENV=production
19+
ENV NEXT_TELEMETRY_DISABLED=1
1820

19-
# If you use Next "standalone" output, enable it in next.config first.
20-
# Otherwise this still works fine by copying .next + node_modules.
21-
22-
COPY --from=builder /app/package*.json ./
23-
COPY --from=builder /app/node_modules ./node_modules
24-
COPY --from=builder /app/.next ./.next
21+
# Standalone server + minimal files
22+
COPY --from=builder /app/.next/standalone ./
23+
COPY --from=builder /app/.next/static ./.next/static
2524
COPY --from=builder /app/public ./public
2625

2726
EXPOSE 3000
28-
CMD ["npm", "run", "start"]
27+
# Standalone output creates server.js at root
28+
CMD ["node", "server.js"]
2929

0 commit comments

Comments
 (0)