Archived
build-and-publish / build (push) Failing after 11s
- next.config: output 'standalone' for a self-contained server bundle - Dockerfile: multi-stage Next.js build (node:22-alpine) - .gitea/workflows/deploy.yml: build + push to the Gitea registry Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
31 lines
955 B
Docker
31 lines
955 B
Docker
# syntax=docker/dockerfile:1
|
|
# Multi-stage build for the Next.js (standalone) itsthevine.com site.
|
|
|
|
FROM node:22-alpine AS deps
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
# framer-motion@11 declares a React 18 peer; project is on React 19 (as built on Vercel)
|
|
RUN npm ci --legacy-peer-deps
|
|
|
|
FROM node:22-alpine AS builder
|
|
WORKDIR /app
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY . .
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
RUN npm run build
|
|
|
|
FROM node:22-alpine AS runner
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production \
|
|
NEXT_TELEMETRY_DISABLED=1 \
|
|
PORT=3000 \
|
|
HOSTNAME=0.0.0.0
|
|
RUN addgroup -g 1001 -S nodejs && adduser -S nextjs -u 1001
|
|
# standalone output already contains a minimal node_modules + server.js
|
|
COPY --from=builder /app/public ./public
|
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
|
USER nextjs
|
|
EXPOSE 3000
|
|
CMD ["node", "server.js"]
|