Scaffolds docs-site/ with the warehack.ing cookie-cutter pattern (Caddy + Node multi-stage Dockerfile, caddy-docker-proxy labels, HMR via WSS). 21 content pages following Diataxis structure: - Start Here: overview, installation, first-steps tutorial - How-To Guides: media players, systemd, notifications, battery/network, bluetooth, service exploration, permissions - Reference: discovery tools, interaction tools, shortcut tools, resources, prompts, environment variables - Explanation: architecture, session vs system bus, confirmation flow, security layers Terminal-green + slate theme. Builds to 22 static HTML pages.
50 lines
923 B
Docker
50 lines
923 B
Docker
FROM node:22-slim AS base
|
|
ENV ASTRO_TELEMETRY_DISABLED=1
|
|
WORKDIR /app
|
|
|
|
# Install dependencies
|
|
FROM base AS deps
|
|
COPY package.json package-lock.json* ./
|
|
RUN npm ci
|
|
|
|
# Build static site
|
|
FROM deps AS build
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# Production: serve from Caddy
|
|
FROM caddy:2-alpine AS prod
|
|
COPY --from=build /app/dist /srv
|
|
COPY <<'CADDYFILE' /etc/caddy/Caddyfile
|
|
:80 {
|
|
root * /srv
|
|
file_server
|
|
encode gzip
|
|
|
|
@hashed path /_astro/*
|
|
header @hashed Cache-Control "public, max-age=31536000, immutable"
|
|
|
|
@unhashed not path /_astro/*
|
|
header @unhashed Cache-Control "public, max-age=3600"
|
|
|
|
handle_errors {
|
|
@404 expression {err.status_code} == 404
|
|
handle @404 {
|
|
rewrite * /404.html
|
|
file_server
|
|
}
|
|
}
|
|
|
|
try_files {path} {path}/ /index.html
|
|
}
|
|
CADDYFILE
|
|
|
|
EXPOSE 80
|
|
|
|
# Development: Node with HMR
|
|
FROM deps AS dev
|
|
ENV ASTRO_TELEMETRY_DISABLED=1
|
|
COPY . .
|
|
EXPOSE 4321
|
|
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
|