# Observability on $5 self-host stack — Uptime Kuma + Grafana
# Curl + run:
#   curl -O https://osalt.dev/stack/observability-on-five-bucks/compose.yml
#   curl -O https://osalt.dev/stack/observability-on-five-bucks/.env.example && mv .env.example .env
#   docker compose up -d
#
# Honest cost note: Uptime Kuma alone fits in $5/mo. Grafana adds memory but
# stays inside $10. The full editorial stack (adding Prometheus + Plausible +
# Cachet + Keep) typically pushes you to $15-20/mo on real workloads.
#
# Not in this file (per stack editorial):
#   - Plausible Analytics: heavy (postgres + clickhouse). See
#     https://github.com/plausible/community-edition.
#   - Cachet: needs MySQL — see https://github.com/CachetHQ/Docker.
#   - Keep: multi-container (api + frontend + workers + redis). See
#     https://docs.keephq.dev/deployment/docker-compose.

services:
  uptime-kuma:
    image: louislam/uptime-kuma:1.23.13
    restart: unless-stopped
    ports:
      - "${UPTIME_KUMA_PORT:-3001}:3001"
    environment:
      TZ: ${TZ:-UTC}
    volumes:
      - uptime_kuma_data:/app/data

  grafana:
    image: grafana/grafana:11.3.0
    restart: unless-stopped
    ports:
      - "${GRAFANA_PORT:-3000}:3000"
    environment:
      GF_SECURITY_ADMIN_USER: ${GRAFANA_ADMIN_USER:-admin}
      GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD:?set GRAFANA_ADMIN_PASSWORD in .env}
      GF_USERS_ALLOW_SIGN_UP: "false"
      GF_SERVER_ROOT_URL: ${GRAFANA_ROOT_URL:-http://localhost:3000}
    volumes:
      - grafana_data:/var/lib/grafana

volumes:
  uptime_kuma_data:
  grafana_data:
