feat: migrate to standard Docker-based CI/CD deployment

- Add Dockerfile for building Next.js images
- Replace init-container deployment with standard deployment
- Add kustomization with image tag tracking
- Add deploy.sh script for CI/CD pipeline

This enables proper GitOps auto-deployment:
1. Build image with commit hash tag
2. Push to GHCR
3. Update kustomization.yaml image tag
4. Flux detects change and restarts pods
This commit is contained in:
Unchained
2026-03-07 11:09:59 +02:00
parent 467b513b67
commit 81d74ced0c
5 changed files with 145 additions and 182 deletions

30
Dockerfile Normal file
View File

@@ -0,0 +1,30 @@
# Multi-stage build for Next.js
FROM node:20-slim AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
RUN npm ci --prefer-offline --no-audit
# Copy source and build
COPY . .
RUN npm run build
# Production stage
FROM node:20-slim AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=3000
ENV HOSTNAME=0.0.0.0
# Copy necessary files from builder
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
EXPOSE 3000
CMD ["node", "server.js"]