gr-mcp-docs/Dockerfile
Ryan Malloy 41114373b9 init: Astro/Starlight docs site for gr-sarsat-modern
Diátaxis-structured documentation for 406 MHz SARSAT beacon reception:
- Tutorials: signal chain walkthrough
- Guides: antenna setup, message decoding
- Reference: block API, signal format
- Explanation: Cospas-Sarsat system overview

Includes extracted images from official Cospas-Sarsat specifications (LFS).
2026-02-13 05:01:21 -07:00

77 lines
2.4 KiB
Docker

# syntax=docker/dockerfile:1
# gr-sarsat-modern documentation site
# Multi-stage build for Astro/Starlight
# ─────────────────────────────────────────────────────────────
# Development stage - with hot reload
# ─────────────────────────────────────────────────────────────
FROM node:22-bookworm-slim AS dev
WORKDIR /app
COPY package*.json ./
RUN npm ci
# Source mounted as volume in docker-compose
EXPOSE 4321
ENV HOST=0.0.0.0
ENV ASTRO_TELEMETRY_DISABLED=1
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
# ─────────────────────────────────────────────────────────────
# Build stage - generate static site
# ─────────────────────────────────────────────────────────────
FROM node:22-bookworm-slim AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
ENV ASTRO_TELEMETRY_DISABLED=1
RUN npm run build
# ─────────────────────────────────────────────────────────────
# Production stage - serve static files with Caddy
# ─────────────────────────────────────────────────────────────
FROM caddy:2-alpine AS prod
COPY --from=builder /app/dist /srv
COPY <<EOF /etc/caddy/Caddyfile
:80 {
root * /srv
file_server
# SPA fallback
try_files {path} /index.html
# Security headers
header {
X-Content-Type-Options nosniff
X-Frame-Options DENY
Referrer-Policy strict-origin-when-cross-origin
}
# Cache static assets
@static {
path *.js *.css *.woff2 *.png *.svg *.jpg *.webp
}
header @static Cache-Control "public, max-age=31536000, immutable"
# Compress
encode gzip zstd
}
EOF
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s \
CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:80/ || exit 1