Containerize fraud detection consumer - full Docker integration

- Added consumer/Dockerfile with all dependencies
- Updated consumer pipeline.py to use environment variables
- Updated features.py and decision.py to support env var configuration
- Updated docker-compose.yml to include consumer service
- Consumer now runs automatically with 'docker compose up'
- Proper Kafka and Redis networking for Docker
- Environment variables for ML_MODELS_DIR, KAFKA_BROKER, REDIS_HOST/PORT

Now entire PayGuard system runs with: docker compose up -d

Co-authored-by: Copilot <[email protected]>
This commit is contained in:
John Patrick TeruelandCopilot committed 2026-04-24 22:02:56 +08:00
1 parent 529914dd60
commit 4cefdb9083
6 files changed
+106 -14

No files matched your search

+20 -3
View File
@@ -90,9 +90,26 @@ services:
- NODE_ENV=production
- VITE_API_URL=http://localhost:8000
restart: unless-stopped
# NOTE: All services now run in Docker on the same network
# Frontend: http://localhost:8000 (Docker service name resolution)
# Consumer: Still runs on host, connects to kafka:29092
consumer:
build:
context: .
dockerfile: consumer/Dockerfile
networks:
- payguard-network
depends_on:
kafka:
condition: service_healthy
redis:
condition: service_healthy
environment:
- KAFKA_BROKER=kafka:29092
- REDIS_HOST=redis
- REDIS_PORT=6379
- ML_MODELS_DIR=/app/ml_models
restart: unless-stopped
# Consumer runs indefinitely, consuming messages from Kafka and storing results in Redis
# Logs visible via: docker compose logs -f consumer
volumes:
redis_data: