- API image (uv multi-stage, non-root, gunicorn, migrations on start, health check) and UI image (nginx, CSP, config.js rendered from API_BASE_URL); /healthz documented in OpenAPI - docker compose runs db, api and ui; the "monitoring" profile adds Prometheus, postgres-exporter and Grafana, all provisioned from files - Grafana dashboards: API overview (RED), Last.fm API, Usage, Database - Prometheus alert rules: API down, error rate, latency, auth failure spike, ignored scrobbles, DB pool saturation, Postgres down - Pool checkout gauge counts events (the pool's own counters lag the checkin event); error ratios show 0 instead of "No data" - Tests check dashboards and alerts only use metrics that exist - scripts/generate_traffic.py drives realistic traffic for demos Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MK52BGoJbPhZ1vSFuKcGUW
9 lines
413 B
Docker
9 lines
413 B
Docker
# Scrobbler web UI: static files served by nginx.
|
|
FROM nginx:1.29-alpine
|
|
ENV API_BASE_URL=http://localhost:5050
|
|
COPY deploy/nginx/default.conf.template /etc/nginx/templates/default.conf.template
|
|
COPY docker/ui-config.sh /docker-entrypoint.d/40-scrobbler-config.sh
|
|
COPY frontend /usr/share/nginx/html
|
|
EXPOSE 80
|
|
HEALTHCHECK --interval=15s --timeout=3s CMD wget -qO- http://127.0.0.1/login.html >/dev/null || exit 1
|