| version: '3.8' | |
| services: | |
| # TB-Guard-XAI Main Application | |
| app: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile | |
| container_name: tb-guard-app | |
| ports: | |
| - "7860:7860" | |
| environment: | |
| - MISTRAL_API_KEY=${MISTRAL_API_KEY} | |
| - GEMINI_API_KEY=${GEMINI_API_KEY} | |
| - HF_API_KEY=${HF_API_KEY} | |
| - ENV=production | |
| - HOST=0.0.0.0 | |
| - PORT=7860 | |
| - REDIS_URL=redis://redis:6379 | |
| - QDRANT_URL=http://qdrant:6333 | |
| depends_on: | |
| - redis | |
| - qdrant | |
| volumes: | |
| - ./models:/app/models:ro | |
| - ./temp_uploads:/app/temp_uploads | |
| - ./batch_reports:/app/batch_reports | |
| - ./performance_logs:/app/performance_logs | |
| restart: unless-stopped | |
| networks: | |
| - tb-guard-network | |
| healthcheck: | |
| test: ["CMD", "curl", "-f", "http://localhost:7860/health"] | |
| interval: 30s | |
| timeout: 10s | |
| retries: 3 | |
| start_period: 40s | |
| # Redis for Celery (future async tasks) | |
| redis: | |
| image: redis:7-alpine | |
| container_name: tb-guard-redis | |
| ports: | |
| - "6379:6379" | |
| volumes: | |
| - redis_data:/data | |
| restart: unless-stopped | |
| networks: | |
| - tb-guard-network | |
| healthcheck: | |
| test: ["CMD", "redis-cli", "ping"] | |
| interval: 10s | |
| timeout: 5s | |
| retries: 3 | |
| # Qdrant Vector Database | |
| qdrant: | |
| image: qdrant/qdrant:latest | |
| container_name: tb-guard-qdrant | |
| ports: | |
| - "6333:6333" | |
| volumes: | |
| - qdrant_data:/qdrant/storage | |
| environment: | |
| QDRANT_API_KEY: "" # No auth for local development | |
| restart: unless-stopped | |
| networks: | |
| - tb-guard-network | |
| healthcheck: | |
| test: ["CMD", "curl", "-f", "http://localhost:6333/health"] | |
| interval: 10s | |
| timeout: 5s | |
| retries: 3 | |
| volumes: | |
| redis_data: | |
| driver: local | |
| qdrant_data: | |
| driver: local | |
| networks: | |
| tb-guard-network: | |
| driver: bridge | |
| # Usage: | |
| # 1. Create .env file with API keys | |
| # 2. Place pre-trained models in ./models/ | |
| # 3. Run: docker-compose up -d | |
| # 4. Access: http://localhost:7860 | |
| # 5. API Docs: http://localhost:7860/docs | |
| # 6. Stop: docker-compose down | |