- Multi-stage Dockerfile: Node builder → Caddy static prod, Node HMR dev - docker-compose with dev/prod profiles on external caddy network - Caddyfile with immutable hashed asset caching - Makefile: prod, dev, down, logs, rebuild targets - Site URL configurable via SITE_URL env var
16 lines
373 B
Caddyfile
16 lines
373 B
Caddyfile
:80 {
|
|
root * /srv
|
|
file_server
|
|
|
|
# Hashed assets are immutable
|
|
@hashed path /_astro/*
|
|
header @hashed Cache-Control "public, max-age=31536000, immutable"
|
|
|
|
# Everything else: short cache, revalidate
|
|
@unhashed not path /_astro/*
|
|
header @unhashed Cache-Control "public, max-age=3600, must-revalidate"
|
|
|
|
# SPA fallback for clean URLs
|
|
try_files {path} {path}/ /404.html
|
|
}
|