web-ui: wave-1 finish — self-host fonts + multi-stage Dockerfile

Fonts: Inter 400/500/600 + JetBrains Mono 400/600 (woff2 from rsms/inter and JetBrains/JetBrainsMono github).

Dockerfile: two-stage build. Stage 1 (node:20-alpine) runs tailwindcss --minify to emit public/dist/app.css. Stage 2 (nginx:alpine) ships the static result.

NOTE on task 19 (nginx caching for /dist /fonts): SKIPPED. The existing nginx.conf already caches *.css and *.woff2 for 1y immutable via the generic location ~* \\.(css|...|woff2|...)$ regex. Adding explicit /dist/ and /fonts/ blocks would be redundant.
This commit is contained in:
Zac Gaetano 2026-05-21 16:32:55 +00:00
parent 6561cecf33
commit f9236101b9
6 changed files with 18 additions and 1 deletions

View file

@ -1,4 +1,21 @@
# Stage 1: build CSS bundle
FROM node:20-alpine AS css-build
WORKDIR /build
# Copy only the files needed to install deps (better cache layering)
COPY package.json package-lock.json* ./
RUN npm install --no-audit --no-fund
# Copy source CSS + tailwind config + every HTML file (tailwind scans HTML to determine which utilities to emit)
COPY tailwind.config.js postcss.config.js ./
COPY src/ ./src/
COPY public/ ./public/
# Build into public/dist/app.css
RUN npx tailwindcss -i ./src/css/app.css -o ./public/dist/app.css --minify
# Stage 2: runtime
FROM nginx:alpine
COPY public/ /usr/share/nginx/html/
COPY --from=css-build /build/public/ /usr/share/nginx/html/
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.