Multi-stage build: Node 22 for Astro build, Caddy 2 Alpine for static file serving. Reverse-proxied via caddy-docker-proxy.
25 lines
582 B
Caddyfile
25 lines
582 B
Caddyfile
:8080 {
|
|
root * /srv
|
|
file_server
|
|
|
|
handle /health {
|
|
respond "OK" 200
|
|
}
|
|
|
|
# SPA-style fallback for clean URLs
|
|
try_files {path} {path}/ {path}.html /index.html
|
|
|
|
# Cache static assets aggressively
|
|
@static path *.css *.js *.svg *.png *.webp *.jpg *.jpeg *.gif *.ico *.woff *.woff2
|
|
header @static Cache-Control "public, max-age=31536000, immutable"
|
|
|
|
# Security headers
|
|
header {
|
|
X-Content-Type-Options "nosniff"
|
|
X-Frame-Options "DENY"
|
|
Referrer-Policy "strict-origin-when-cross-origin"
|
|
}
|
|
|
|
encode gzip zstd
|
|
}
|