# Static landing container. 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"

	# The public offer page (/offer/) is no longer served here: the contour caddy routes it to the
	# render sidecar, which splices the live catalog price list into ui/legal/offer_ru.md. This
	# container never sees /offer/, so it carries no offer assets (the vite emit-offer plugin is gone).

	# An unknown path falls back to the landing shell (the gateway's old "/"
	# behaviour); "/" itself resolves through the index below.
	handle {
		try_files {path} /landing.html
		file_server {
			index landing.html
		}
	}
}
