pediatric-ai-scribe-v3/docker-compose.monitoring.yml
Daniel 47844ff29b Add Loki + Grafana monitoring stack, ntfy notifications, biometric auth
Monitoring:
- docker-compose.monitoring.yml — opt-in Loki + Grafana stack
- Loki config with 6-year retention (HIPAA compliant)
- Grafana auto-provisioned with Loki datasource + PedScribe dashboard
  (login activity, failed logins, clinical actions, API calls, log viewer)
- Logger ships to Loki in parallel with PostgreSQL (fire-and-forget)
- Labels: app=pedscribe, type=audit|api_call|access, category, action

Usage: docker compose -f docker-compose.yml -f docker-compose.monitoring.yml up -d
Grafana at localhost:3003 (admin/pedscribe)

Notifications:
- ntfy push support (src/utils/notify.js)
- Notifications on: login, password change, registration
- Self-hosted, no Firebase dependency

Mobile:
- Biometric auth on app launch (Face ID/Touch ID/fingerprint)
- PIN/password fallback, auto-prompt, skip option
2026-04-11 03:00:52 +02:00

52 lines
1.6 KiB
YAML

## Monitoring stack — Loki + Grafana
## Usage: docker compose -f docker-compose.yml -f docker-compose.monitoring.yml up -d
##
## Grafana: http://localhost:3003 (admin/admin on first login)
## Loki: http://localhost:3100 (internal, used by Grafana)
##
## The app sends logs to Loki via HTTP at http://loki:3100/loki/api/v1/push
services:
loki:
image: grafana/loki:3.4.2
ports:
- "127.0.0.1:3100:3100"
command: -config.file=/etc/loki/loki-config.yaml
volumes:
- loki-data:/loki
- ./monitoring/loki-config.yaml:/etc/loki/loki-config.yaml:ro
restart: unless-stopped
container_name: pedscribe-loki
healthcheck:
test: ["CMD-SHELL", "wget --spider -q http://localhost:3100/ready"]
interval: 30s
timeout: 5s
retries: 3
grafana:
image: grafana/grafana:11.6.0
ports:
- "127.0.0.1:3003:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=pedscribe
- GF_USERS_ALLOW_SIGN_UP=false
- GF_AUTH_ANONYMOUS_ENABLED=false
volumes:
- grafana-data:/var/lib/grafana
- ./monitoring/grafana-datasource.yaml:/etc/grafana/provisioning/datasources/loki.yaml:ro
- ./monitoring/grafana-dashboards.yaml:/etc/grafana/provisioning/dashboards/dashboards.yaml:ro
- ./monitoring/dashboards:/var/lib/grafana/dashboards:ro
depends_on:
loki:
condition: service_healthy
restart: unless-stopped
container_name: pedscribe-grafana
# Override the main app to add Loki env
pediatric-scribe:
environment:
- LOKI_URL=http://loki:3100
volumes:
loki-data:
grafana-data: