Spaces:
Runtime error
Runtime error
| # docker-compose.yml | |
| version: '3.8' | |
| services: | |
| # Triton Inference Server | |
| triton-server: | |
| image: nvcr.io/nvidia/tritonserver:23.10-py3 | |
| container_name: triton-diamond-ai | |
| runtime: nvidia | |
| deploy: | |
| resources: | |
| reservations: | |
| devices: | |
| - driver: nvidia | |
| count: all | |
| capabilities: [gpu] | |
| ports: | |
| - "8000:8000" # HTTP | |
| - "8001:8001" # gRPC | |
| - "8002:8002" # Metrics | |
| volumes: | |
| - ./models/triton_model_repository:/models | |
| - ./configs/triton_model_config.pbtxt:/models/wizardlm_7b/config.pbtxt | |
| environment: | |
| - NVIDIA_VISIBLE_DEVICES=all | |
| - CUDA_VISIBLE_DEVICES=0,1 | |
| command: > | |
| tritonserver | |
| --model-repository=/models | |
| --http-port=8000 | |
| --grpc-port=8001 | |
| --metrics-port=8002 | |
| --log-verbose=1 | |
| --model-control-mode=poll | |
| --repository-poll-secs=30 | |
| healthcheck: | |
| test: ["CMD", "curl", "-f", "http://localhost:8000/v2/health/ready"] | |
| interval: 30s | |
| timeout: 10s | |
| retries: 3 | |
| networks: | |
| - diamond-network | |
| # FastAPI Backend | |
| api-server: | |
| build: | |
| context: . | |
| dockerfile: Dockerfile.api | |
| container_name: diamond-api | |
| ports: | |
| - "8080:8080" | |
| depends_on: | |
| triton-server: | |
| condition: service_healthy | |
| environment: | |
| - TRITON_URL=triton-server:8001 | |
| - SOLANA_RPC_URL=https://api.mainnet-beta.solana.com | |
| - DIAMOND_TOKEN_ADDRESS=5zJo2GzYRgiZw5j3SBNpuqVcGok35kT3ADwsw74yJWV6 | |
| - PLATFORM_PRIVATE_KEY=${PLATFORM_PRIVATE_KEY} | |
| - REDIS_URL=redis:6379 | |
| volumes: | |
| - ./data:/app/data | |
| - ./logs:/app/logs | |
| networks: | |
| - diamond-network | |
| command: > | |
| uvicorn api.main:app | |
| --host 0.0.0.0 | |
| --port 8080 | |
| --workers 4 | |
| --log-level info | |
| # Redis para caching | |
| redis: | |
| image: redis:7-alpine | |
| container_name: diamond-redis | |
| ports: | |
| - "6379:6379" | |
| volumes: | |
| - redis-data:/data | |
| networks: | |
| - diamond-network | |
| # PostgreSQL para datos | |
| postgres: | |
| image: postgres:15-alpine | |
| container_name: diamond-postgres | |
| environment: | |
| - POSTGRES_USER=diamond | |
| - POSTGRES_PASSWORD=${DB_PASSWORD} | |
| - POSTGRES_DB=diamond_ai | |
| ports: | |
| - "5432:5432" | |
| volumes: | |
| - postgres-data:/var/lib/postgresql/data | |
| - ./scripts/init-db.sql:/docker-entrypoint-initdb.d/init.sql | |
| networks: | |
| - diamond-network | |
| # Frontend React | |
| frontend: | |
| build: | |
| context: ./frontend | |
| dockerfile: Dockerfile | |
| container_name: diamond-frontend | |
| ports: | |
| - "3000:3000" | |
| depends_on: | |
| - api-server | |
| environment: | |
| - REACT_APP_API_URL=http://localhost:8080 | |
| - REACT_APP_SOLANA_NETWORK=mainnet-beta | |
| - REACT_APP_DIAMOND_TOKEN_ADDRESS=5zJo2GzYRgiZw5j3SBNpuqVcGok35kT3ADwsw74yJWV6 | |
| networks: | |
| - diamond-network | |
| # Prometheus + Grafana para monitoreo | |
| prometheus: | |
| image: prom/prometheus:latest | |
| container_name: diamond-prometheus | |
| volumes: | |
| - ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml | |
| - prometheus-data:/prometheus | |
| ports: | |
| - "9090:9090" | |
| networks: | |
| - diamond-network | |
| grafana: | |
| image: grafana/grafana:latest | |
| container_name: diamond-grafana | |
| ports: | |
| - "3001:3000" | |
| environment: | |
| - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD} | |
| volumes: | |
| - grafana-data:/var/lib/grafana | |
| - ./monitoring/dashboards:/etc/grafana/provisioning/dashboards | |
| depends_on: | |
| - prometheus | |
| networks: | |
| - diamond-network | |
| volumes: | |
| redis-data: | |
| postgres-data: | |
| prometheus-data: | |
| grafana-data: | |
| networks: | |
| diamond-network: | |
| driver: bridge |