add Docker and CI/CD pipeline with ledo
Some checks failed
Docker - build image / 🏗️ Docker builder (latest from master) 🏗️ (push) Failing after 17s
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>
This commit is contained in:
35
Dockerfile
Normal file
35
Dockerfile
Normal file
@@ -0,0 +1,35 @@
|
||||
# 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;"]
|
||||
Reference in New Issue
Block a user