Astro/Starlight documentation site with 8 content pages: - Circuit design (SPICE validation, R2 sweep data, K-line compat) - Firmware architecture (composition diagram, concurrency model) - BMW I/K-Bus protocol (message format, module addresses) - OBD-II K-line protocol (init sequences, PID decode formulas) - Bill of materials - Getting started guide - Development journal (4-session engineering log) Docker deployment: multi-stage build (Node builder + Caddy static), caddy-docker-proxy labels, Makefile for management.
48 lines
894 B
Docker
48 lines
894 B
Docker
# Build stage
|
|
FROM node:22-slim AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci
|
|
|
|
COPY . .
|
|
|
|
ENV ASTRO_TELEMETRY_DISABLED=1
|
|
RUN npm run build
|
|
|
|
# Production stage — Caddy serves static files
|
|
FROM caddy:2-alpine AS production
|
|
|
|
COPY --from=builder /app/dist /srv
|
|
|
|
COPY <<EOF /etc/caddy/Caddyfile
|
|
:80 {
|
|
root * /srv
|
|
file_server
|
|
try_files {path} {path}/ /index.html
|
|
encode gzip
|
|
|
|
@static path *.js *.css *.png *.jpg *.jpeg *.gif *.ico *.svg *.woff *.woff2
|
|
header @static Cache-Control "public, max-age=31536000, immutable"
|
|
|
|
@html path *.html
|
|
header @html Cache-Control "no-cache, no-store, must-revalidate"
|
|
}
|
|
EOF
|
|
|
|
EXPOSE 80
|
|
|
|
# Development stage
|
|
FROM node:22-slim AS development
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci
|
|
|
|
EXPOSE 4321
|
|
|
|
ENV ASTRO_TELEMETRY_DISABLED=1
|
|
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
|