This repository has been archived on 2026-09-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
itsthevine/Dockerfile
T
austinandClaude Opus 4.8 d1cbe93721
build-and-publish / build (push) Failing after 11s
Add Docker build + Gitea Actions CI for self-hosting
- 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]>
2026-07-22 10:44:04 -05:00

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"]