mirror of
https://github.com/mblanke/Lottery-Tracker.git
synced 2026-03-01 14:10:22 -05:00
93 lines
2.0 KiB
Markdown
93 lines
2.0 KiB
Markdown
# Docker Quick Start
|
|
|
|
## What's Included
|
|
|
|
### Docker Files
|
|
- `Dockerfile.backend` — Flask API with Playwright & Chromium
|
|
- `Dockerfile.frontend` — Next.js standalone production build
|
|
- `docker-compose.yml` — Development setup (backend + frontend)
|
|
- `docker-compose.prod.yml` — Production setup (+ nginx reverse proxy)
|
|
- `nginx.conf` — Reverse proxy with rate limiting & caching
|
|
- `.env.example` — All available environment variables
|
|
|
|
---
|
|
|
|
## Quick Start
|
|
|
|
### 1. Configure
|
|
```bash
|
|
cp .env.example .env
|
|
```
|
|
|
|
### 2. Start
|
|
```bash
|
|
# Windows
|
|
docker-start.bat
|
|
|
|
# Linux/macOS
|
|
./docker-start.sh
|
|
|
|
# Or directly
|
|
docker compose up -d
|
|
```
|
|
|
|
### 3. Open
|
|
- **Frontend**: http://localhost:3000
|
|
- **Backend API**: http://localhost:5000
|
|
- **Health Check**: http://localhost:5000/api/health
|
|
|
|
---
|
|
|
|
## What Gets Deployed
|
|
|
|
### Backend Container
|
|
- Python 3.13 + Flask + Gunicorn (2 workers)
|
|
- Playwright with Chromium (for Canadian lottery scraping)
|
|
- Unified scraper for Powerball, Mega Millions, Lotto Max, Lotto 6/49
|
|
- Investment calculator with tax, annuity, group play, break-even
|
|
- TTL-cached jackpot data (6 hours default)
|
|
|
|
### Frontend Container
|
|
- Node.js 20 + Next.js 15 standalone build
|
|
- Material-UI dark theme
|
|
- 6 interactive pages (Calculator, Compare, Break-Even, Annuity, Group Play, Odds)
|
|
|
|
### Nginx (Production Only)
|
|
- Reverse proxy for API and frontend
|
|
- Rate limiting (10 req/s burst 20)
|
|
- Static asset caching (30 days)
|
|
- HTTPS ready (see `ssl/README.md`)
|
|
|
|
---
|
|
|
|
## Common Commands
|
|
|
|
```bash
|
|
# View logs
|
|
docker compose logs -f
|
|
|
|
# Restart
|
|
docker compose restart
|
|
|
|
# Rebuild after code changes
|
|
docker compose up -d --build
|
|
|
|
# Stop
|
|
docker compose down
|
|
|
|
# Production
|
|
docker compose -f docker-compose.prod.yml up -d
|
|
```
|
|
|
|
---
|
|
|
|
## Troubleshooting
|
|
|
|
1. **Check Docker Desktop is running**
|
|
2. **Ensure ports 3000 and 5000 are available**
|
|
3. **Check logs**: `docker compose logs`
|
|
4. **Rebuild**: `docker compose up -d --build`
|
|
5. **Reset**: `docker compose down && docker compose up -d`
|
|
|
|
See `DOCKER_README.md` for detailed troubleshooting.
|