Migrate Vite SPA to Hugo (hugo-coder, dark) with WebGPU background

- Hugo static site at root: config, content (home/about/resume/blog + 5 projects),
  data/resume.yaml, custom layouts (gpu background, resume renderer, projects list),
  dark theme with canvas behind content
- gpu-bg/: extracted WebGPU/WebGL2 spiral engine as a Vite sub-package; slim bootstrap
  drops router/overlay/text renderer; fixed uniforms (scene0/dim0); self-contained engine.js
- archive/: retired Vite SPA preserved (router, overlay, data, engine/text orphaned)
- 3-stage Dockerfile (node -> hugo extended/dart-sass -> nginx), static nginx config
- DEPLOYMENT.md handover + README rewrite; pre-hugo rollback tag
This commit is contained in:
2026-08-21 03:39:42 +02:00
parent 3ad5cf55e3
commit 9ea85db5ce
74 changed files with 3170 additions and 75 deletions

View File

@@ -1,34 +1,24 @@
# ---- stage 1: build ----
FROM node:22-alpine AS build
WORKDIR /app
# Install deps (cache layer)
COPY package.json package-lock.json* ./
FROM node:22-alpine AS engine
WORKDIR /gpu
COPY gpu-bg/package.json gpu-bg/package-lock.json* ./
RUN npm ci
# Copy source and build
COPY tsconfig.json vite.config.ts index.html ./
COPY src/ src/
# Run tests first — gates the build
RUN npm test
COPY gpu-bg/ ./
RUN npm run build
# ---- stage 2: serve ----
# hugomods/hugo is the maintained successor to the deprecated klakegg/hugo image.
# The "dart-sass" variant is extended Hugo + dart-sass (required: hugo-coder compiles
# SCSS via toCSS, and Hugo 0.129+ dropped libsass in favor of dart-sass).
FROM hugomods/hugo:debian-dart-sass-go-0.165.0 AS site
WORKDIR /site
COPY . .
COPY --from=engine /gpu/dist ./static/gpu/
RUN hugo --minify
FROM nginx:alpine-slim AS serve
# curl needed for the healthcheck in docker-compose
RUN apk add --no-cache curl
COPY --from=build /app/dist /usr/share/nginx/html
# Wipe any default server blocks that could conflict with our config.
COPY --from=site /site/public /usr/share/nginx/html
RUN rm -f /etc/nginx/conf.d/default.conf
# Deploy our custom nginx config and validate it at build time
COPY nginx.default.conf /etc/nginx/conf.d/default.conf
RUN nginx -t
EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"]
CMD ["nginx", "-g", "daemon off;"]