Spaces:
Running
Running
File size: 1,178 Bytes
5259cf2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | # Docker Setup
This project includes Docker configuration for easy deployment and monitoring.
## Services
- **FastAPI App** (port 8000): Main ML API
- **Prometheus** (port 9090): Metrics collection
- **Grafana** (port 3000): Visualization dashboards
## Quick Start
### 1. Build and Start
```bash
docker-compose up -d
```
### 2. Access Services
- API: http://localhost:8000
- API Docs: http://localhost:8000/docs
- Prometheus: http://localhost:9090
- Grafana: http://localhost:3000 (admin/admin)
### 3. Stop Services
```bash
docker-compose down
```
## Useful Commands
```bash
# View logs
docker-compose logs -f
# View app logs only
docker-compose logs -f app
# Rebuild after code changes
docker-compose up -d --build
# Stop and remove volumes
docker-compose down -v
```
## Environment Variables
Create `.env` file with:
```
MLFLOW_TRACKING_URI=your_dagshub_uri
DAGSHUB_TOKEN=your_token
```
## Grafana Setup
1. Login to Grafana (admin/admin)
2. Datasources are auto-configured
3. Dashboards are auto-loaded
## Health Checks
```bash
# Check app health
curl http://localhost:8000/health
# Check Prometheus targets
curl http://localhost:9090/api/v1/targets
```
|