Add Docker + nginx deployment for homelab

- Multi-stage Dockerfile: Node builds static assets, nginx serves them
- nginx proxies /api/* to football-data.org and injects X-Auth-Token
  server-side via FOOTBALL_API_KEY env var (key never in browser bundle)
- docker-compose.yml exposes the app on port 3000
- Extract apiFetch() helper: sends key in dev (Vite proxy), skips in prod
- .env.example updated with both dev and production key vars

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-14 07:40:20 +01:00
parent d8fba41ea5
commit 5db020132e
8 changed files with 70 additions and 24 deletions

View File

@@ -1 +1,5 @@
# Used by docker-compose (nginx injects it server-side — never exposed to browser)
FOOTBALL_API_KEY=your_api_key_here
# Only needed for local development (npm run dev)
VITE_FOOTBALL_API_KEY=your_api_key_here