Some checks failed
Docker - build image / 🏗️ Docker builder (latest from master) 🏗️ (push) Failing after 17s
Configure Next.js static export with nginx serving, Dockerfile (multi-stage build), docker-compose for prod/dev, Gitea Actions pipelines for build-on-push and tag-based releases using ledo tool. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
36 lines
714 B
Docker
36 lines
714 B
Docker
# syntax=docker/dockerfile:1.7
|
|
|
|
############################
|
|
# 1) Dependencies
|
|
############################
|
|
FROM node:20-alpine AS deps
|
|
WORKDIR /app
|
|
|
|
RUN apk add --no-cache libc6-compat
|
|
|
|
COPY package.json package-lock.json* ./
|
|
RUN npm ci
|
|
|
|
############################
|
|
# 2) Build stage
|
|
############################
|
|
FROM node:20-alpine AS build
|
|
WORKDIR /app
|
|
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY . .
|
|
|
|
RUN npm run build
|
|
|
|
############################
|
|
# 3) Production stage (nginx)
|
|
############################
|
|
FROM nginx:1.27-alpine AS production
|
|
|
|
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
|
|
COPY --from=build /app/out /usr/share/nginx/html
|
|
|
|
EXPOSE 8080
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|