Abeshith's picture
Docker Stages Implemented
5259cf2
# 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
```