feat(dashboard): frontend web PORT06 — stato live, PnL totale/per-strategia, grafici, trade

Server stdlib http.server (zero dipendenze nuove) che legge data/: KPI equity/PnL/DD,
grafico equity (Chart.js CDN + fallback), PnL per-strategia (barre, realizzato reale),
trade attivi in TEMPO REALE (mark Cerbero best-effort, PnL non realizzato, barre, eta
stantio) e chiusi (ultimi 50). Servizio docker-compose 'dashboard' porta 8787, stessa
immagine, monta data/, restart unless-stopped + healthcheck. Nessuna auth -> rete interna.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Adriano Dal Pastro
2026-06-13 19:46:47 +00:00
parent dc22256e0e
commit 31f08ddf32
3 changed files with 394 additions and 0 deletions
+26
View File
@@ -18,3 +18,29 @@ services:
retries: 3
labels:
- com.centurylinklabs.watchtower.enable=false
# Dashboard web read-only (stato live, PnL totale/per-strategia, grafico equity,
# trade attivi+chiusi). Stessa immagine del runner, monta gli stessi data/ in sola
# lettura logica (legge equity.jsonl + status/trades dei worker). Porta 8787.
# NB: nessuna auth -> non esporre su internet pubblico, solo rete interna/VPN.
dashboard:
build: .
container_name: pythagoras-dashboard
restart: unless-stopped
command: ["uv", "run", "python", "-m", "src.live.dashboard", "--port", "8787"]
ports:
- "8787:8787"
volumes:
- ./data:/app/data
- ./portfolios.yml:/app/portfolios.yml:ro
env_file:
- .env
environment:
- PYTHONUNBUFFERED=1
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8787/api/state', timeout=5)"]
interval: 120s
timeout: 10s
retries: 3
labels:
- com.centurylinklabs.watchtower.enable=false