- k8s/using-cash/: namespace, deployment (2 replicas, rolling), service, ingress - apex (using.cash) with Let's Encrypt TLS via cert-manager HTTP-01 - www.using.cash permanent-redirect → using.cash - app.using.cash placeholder ingress (DNS slot reserved for product app) - k8s/analytics/: Plausible CE + Postgres 16 + ClickHouse 24.3 with PVCs - stats.using.cash ingress with TLS - init containers wait for Postgres and ClickHouse before Plausible starts - Secrets created out-of-band; placeholder files document the kubectl commands - Dockerfile: multi-stage Next.js static export → nginx:alpine (port 8080, non-root) - nginx.conf: trailing-slash static export support, immutable asset caching, security headers - .gitea/workflows/deploy.yml: CI build→push→rollout on push to main - docs/deploy.md: first-apply checklist, DNS cutover procedure, rollback commands Co-Authored-By: Paperclip <noreply@paperclip.ing>
16 lines
453 B
Docker
16 lines
453 B
Docker
# Stage 1: build Next.js static export
|
|
FROM node:20-alpine AS builder
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm ci --prefer-offline
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# Stage 2: serve with nginx (non-root, port 8080)
|
|
FROM nginx:1.27-alpine
|
|
COPY --from=builder /app/out /usr/share/nginx/html
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
EXPOSE 8080
|
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s \
|
|
CMD wget -qO- http://localhost:8080/ || exit 1
|