Spaces:
Running
Running
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
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
docker-compose down
Useful Commands
# 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
- Login to Grafana (admin/admin)
- Datasources are auto-configured
- Dashboards are auto-loaded
Health Checks
# Check app health
curl http://localhost:8000/health
# Check Prometheus targets
curl http://localhost:9090/api/v1/targets