feat(sentinel1): Sentinel-1 SAR STAC -> self-hosted TiTiler tile template

Add GET /api/map/sentinel1?bbox=... which queries Planetary Computer STAC
(sentinel-1-grd, last 7d, most recent), signs the vv/hh COG with a SAS token,
and returns a same-origin /titiler/... XYZ tile template. Cache keyed on
quantized bbox + UTC day (20 min TTL). 429 -> 429 (Retry-After), no imagery
-> 404, other upstream errors -> 502.

Self-host TiTiler on the Pi (ghcr.io/developmentseed/titiler, arm64, 1G cap,
host loopback 8001 -> container 8000) instead of titiler.xyz. nginx
/titiler/ proxy snippet routes browser tiles to it; TITILER_PUBLIC_BASE and
TITILER_INTERNAL_URL are env-driven (no hardcoded hostnames).
This commit is contained in:
Sirius DevOps 2026-08-29 01:01:09 -04:00
commit 5212aaa5cd
6 changed files with 346 additions and 5 deletions

View file

@ -131,6 +131,9 @@ services:
AISSTREAM_API_KEY: ${AISSTREAM_API_KEY:-}
AISSTREAM_BBOX: ${AISSTREAM_BBOX:-24,-125,50,-66}
AISSTREAM_IN_APP: ${AISSTREAM_IN_APP:-1}
# ── Self-hosted TiTiler (Sentinel-1 SAR tiles) ──
TITILER_PUBLIC_BASE: ${TITILER_PUBLIC_BASE:-/titiler}
TITILER_INTERNAL_URL: ${TITILER_INTERNAL_URL:-http://titiler:8000}
ports:
- "127.0.0.1:8000:8000"
deploy:
@ -143,6 +146,27 @@ services:
timeout: 5s
retries: 5
# ── Self-hosted TiTiler (Sentinel-1 SAR COG → XYZ tiles) ────────────────
# Warps the signed Planetary Computer COG into WebMercator XYZ tiles so the
# browser never loads a multi-GB GeoTIFF. The FastAPI app signs the COG URL
# and returns a /titiler/... template; nginx routes /titiler/ here.
# Listens on 8000 INSIDE the container (the app already owns host 8000);
# published on host loopback 127.0.0.1:8001 only.
titiler:
image: ghcr.io/developmentseed/titiler:latest
container_name: osint-titiler
platform: linux/arm64
restart: unless-stopped
environment:
- PORT=8000
- WORKERS_PER_CORE=1
ports:
- "127.0.0.1:8001:8000"
deploy:
resources:
limits:
memory: 1G
camera-service:
build:
context: .