DAFU - Data Analytics Functional Utilities - Docker Configuration Documentation
- ../guides/QUICK_START.md - Get ML models running in 5 minutes
- DOCKER_SETUP.md - Docker infrastructure documentation
- ../README.md - Main project documentation
Docker services are currently commented out in docker-compose.yml until API-ML integration is complete.
git clone https://github.com/MasterFabric/dafu.git
cd dafu/fraud_detection
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cd src/models
python main.py # All ML features work!# After uncommenting services in docker-compose.yml:
make setup- 🔄 Fraud Detection API - FastAPI structure ready
- 🔄 PostgreSQL - Schema prepared
- 🔄 Redis - Configuration ready
- 🔄 RabbitMQ - Configuration ready
- 🔄 Celery Workers - Not implemented
- 🔄 Prometheus - Configuration ready
- 🔄 Grafana - Configuration ready
- ✅ Docker Compose configuration complete
- ✅ Database schemas designed
- ✅ Service definitions prepared
- ✅ Network configuration ready
- ✅ Volume management configured
⚠️ Awaiting API-ML integration
- ✅ All ML models (Isolation Forest, LSTM, GRU)
- ✅ Model training and prediction
- ✅ Stream and batch processing
- ✅ Model persistence
- ✅ Data visualization
- ✅ Result export
docker-compose.yml- Main orchestration file.env- Environment configuration.env.example- Template for environment variables.dockerignore- Docker build exclusions.gitignore- Updated with Docker artifacts
core/features/fraud_detection/deployment/Dockerfile- Multi-stage buildcore/features/fraud_detection/deployment/init-db.sql- Database schemacore/features/fraud_detection/deployment/prometheus.yml- Metrics configcore/features/fraud_detection/deployment/grafana-datasources.yml- Grafana config
core/features/fraud_detection/src/api/main.py- FastAPI application
start.sh- Service management scriptMakefile- Common operations
../guides/QUICK_START.md- 5-minute guideDOCKER_SETUP.md- Complete documentationDOCKER_../README.md- This file
make setup # Initial setup and start
make start # Start all services
make stop # Stop all services
make restart # Restart services
make logs # View logs
make status # Check status
make clean # Remove all data./start.sh up # Start services
./start.sh down # Stop services
./start.sh logs # View logs
./start.sh status # Check status
./start.sh rebuild # Rebuild and restartdocker-compose up -d # Start
docker-compose down # Stop
docker-compose logs -f # Logs
docker-compose ps # Status
docker-compose restart # Restart
docker-compose up -d --build # RebuildAfter starting services:
| Service | URL | Credentials |
|---|---|---|
| API Docs | http://localhost:8000/docs | - |
| API Health | http://localhost:8000/health | - |
| Grafana | http://localhost:3000 | admin/admin |
| Prometheus | http://localhost:9090 | - |
| RabbitMQ | http://localhost:15672 | dafu/dafu_rabbitmq_password |
curl http://localhost:8000/healthopen http://localhost:8000/docscurl -X POST http://localhost:8000/api/v1/score \
-H "Content-Type: application/json" \
-d '{
"transaction_id": "tx_123",
"amount": 150.00,
"user_id": "user_456",
"merchant_id": "merchant_789",
"timestamp": "2024-01-15T10:30:00Z"
}'┌─────────────────────────────────────────────────────────┐
│ Docker Network │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Fraud API │ │ Celery │ │ Prometheus │ │
│ │ (FastAPI) │ │ Workers │ │ │ │
│ └──────┬───────┘ └──────┬───────┘ └──────────────┘ │
│ │ │ │
│ ┌──────┴───────┬──────────┴─────────┬──────────────┐ │
│ │ │ │ │ │
│ │ PostgreSQL │ Redis │ RabbitMQ │ │
│ │ │ │ │ │
│ └──────────────┘ └──────────────┘ └────────────┘ │
│ │
│ ┌──────────────┐ │
│ │ Grafana │ │
│ │ │ │
│ └──────────────┘ │
└─────────────────────────────────────────────────────────┘
Edit .env file to customize:
# Application
FRAUD_DETECTION_ENV=development
LOG_LEVEL=INFO
API_WORKERS=4
# Ports
API_PORT=8000
POSTGRES_PORT=5432
REDIS_PORT=6379
# Passwords (CHANGE IN PRODUCTION!)
POSTGRES_PASSWORD=dafu_secure_password
RABBITMQ_PASSWORD=dafu_rabbitmq_password
GRAFANA_PASSWORD=admin# Scale API to 3 instances
docker-compose up -d --scale fraud-detection-api=3
# Scale Celery workers to 5 instances
docker-compose up -d --scale celery-worker=5# Change port in .env
echo "API_PORT=8001" >> .env
docker-compose up -d# All services
docker-compose logs -f
# Specific service
docker-compose logs -f fraud-detection-apidocker-compose down -v
docker-compose up -ddocker-compose ps
docker statsDevelopment (Default):
- Default passwords
- All ports exposed
- Debug logging enabled
- No SSL/TLS
Production:
- Change all passwords in
.env - Set
FRAUD_DETECTION_ENV=production - Enable
API_KEY_ENABLED=true - Use reverse proxy with SSL
- Restrict network access
- Enable rate limiting
- Configure monitoring alerts
- Update all passwords
- Enable API key authentication
- Configure SSL/TLS
- Set up firewall rules
- Configure backup strategy
- Enable monitoring alerts
- Review security settings
- Document runbooks
- ../guides/QUICK_START.md - 5-minute quick start
- DOCKER_SETUP.md - Complete documentation
- ../README.md - Project overview
- Docker Docs: https://docs.docker.com
- FastAPI Docs: https://fastapi.tiangolo.com
- Documentation: DOCKER_SETUP.md
- Issues: https://github.com/MasterFabric/dafu/issues
- Email: dafu@masterfabric.co
✅ Complete Platform - All services in one command ✅ Production Ready - Best practices included ✅ Easy to Use - Multiple deployment options ✅ Well Documented - Comprehensive guides ✅ Monitoring - Prometheus & Grafana included ✅ Scalable - Ready for horizontal scaling
- Start:
make setup - Explore: http://localhost:8000/docs
- Monitor: http://localhost:3000
- Customize: Edit
.env - Deploy: Follow production checklist
Built with ❤️ by MasterFabric
DAFU - Data Analytics Functional Utilities - Enterprise Fraud Detection & E-commerce Analytics Platform