Files
scrabble-game/deploy/landing/Caddyfile
T
Ilia Denisov f20a4b49ff R3: split the landing into its own static container
- gateway/Dockerfile gains a `landing` target: caddy:2-alpine + the shared
  Vite build (identical build args keep the ui stage a single cached build);
  the gateway target drops landing.html from the embed.
- The contour caddy routes /app/, /telegram/ and the Connect path to the
  gateway; the catch-all — the landing at / and any stray path — goes to the
  new landing service, so junk traffic is absorbed by static file serving.
- deploy/landing/Caddyfile mirrors the webui caching (immutable assets,
  no-cache shells) and falls back unknown paths to the landing shell.
- The gateway's / now 308-redirects to /app/ (keeps a local no-caddy run
  usable); webui placeholder landing.html removed.
- CI deploy probe checks both / (landing) and /app/ (gateway).

Verified: both images build; the landing container serves landing.html at /
(no-cache) with junk-path fallback; the gateway image redirects / to /app/
and carries no landing content.
2026-06-10 02:20:10 +02:00

28 lines
977 B
Caddyfile

# Static landing container (R3). Serves the public landing page and the built
# assets it references at /; the game SPA (/app/, /telegram/) and the Connect
# edge stay on the gateway. The contour caddy routes the catch-all here, so
# stray public paths are absorbed by static file serving and never reach the Go
# edge. This file is baked into the image at build time (gateway/Dockerfile,
# target `landing`), not bind-mounted.
{
admin off
}
:80 {
root * /srv
encode zstd gzip
# Mirror the gateway webui caching: hash-named build assets are immutable,
# every HTML shell is no-cache so a new deploy is picked up immediately.
header /assets/* Cache-Control "public, max-age=31536000, immutable"
@shell not path /assets/*
header @shell Cache-Control "no-cache"
# An unknown path falls back to the landing shell (the gateway's old "/"
# behaviour); "/" itself resolves through the index below.
try_files {path} /landing.html
file_server {
index landing.html
}
}