Spaces:
Running
Running
File size: 4,180 Bytes
2909918 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | version: '3.8'
services:
translator:
build:
context: .
dockerfile: Dockerfile
target: runtime
image: vibeon-translator:latest
container_name: vibeon-translator
restart: unless-stopped
ports:
- "8000:8000" # API port
- "9090:9090" # Metrics port
volumes:
- ./uploads:/app/uploads
- ./logs:/app/logs
- ./cache:/app/cache
- model-cache:/app/models
environment:
- APP_NAME=vibeon-translator
- API_VERSION=v2
- LOG_LEVEL=INFO
- MAX_WORKERS=4
- ENABLE_GPU=true
- CUDA_VISIBLE_DEVICES=0
- MODEL_CACHE_DIR=/app/models
- REDIS_URL=redis://redis:6379/0
- ENABLE_MONITORING=true
- PROMETHEUS_PORT=9090
depends_on:
- redis
- prometheus
networks:
- translator-network
deploy:
resources:
limits:
memory: 16G
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/v2/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
redis:
image: redis:7-alpine
container_name: vibeon-redis
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- redis-data:/data
command: redis-server --appendonly yes --maxmemory 2gb --maxmemory-policy allkeys-lru
networks:
- translator-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
prometheus:
image: prom/prometheus:latest
container_name: vibeon-prometheus
restart: unless-stopped
ports:
- "9091:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus-data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
networks:
- translator-network
grafana:
image: grafana/grafana:latest
container_name: vibeon-grafana
restart: unless-stopped
ports:
- "3000:3000"
volumes:
- grafana-data:/var/lib/grafana
- ./monitoring/grafana/dashboards:/etc/grafana/provisioning/dashboards
- ./monitoring/grafana/datasources:/etc/grafana/provisioning/datasources
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
- GF_USERS_ALLOW_SIGN_UP=false
depends_on:
- prometheus
networks:
- translator-network
nginx:
image: nginx:alpine
container_name: vibeon-nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./nginx/ssl:/etc/nginx/ssl
- ./web/templates:/usr/share/nginx/html
depends_on:
- translator
networks:
- translator-network
# Optional: Jupyter notebook for testing and development
jupyter:
build:
context: .
dockerfile: Dockerfile
target: runtime
image: vibeon-translator:latest
container_name: vibeon-jupyter
ports:
- "8888:8888"
volumes:
- ./notebooks:/app/notebooks
- model-cache:/app/models
environment:
- JUPYTER_ENABLE_LAB=yes
command: jupyter lab --ip=0.0.0.0 --port=8888 --no-browser --allow-root
networks:
- translator-network
profiles:
- development
# Model downloader service (runs once to download models)
model-downloader:
build:
context: .
dockerfile: Dockerfile
target: builder
container_name: vibeon-model-downloader
volumes:
- model-cache:/app/models
command: python scripts/download_models.py
networks:
- translator-network
profiles:
- setup
volumes:
model-cache:
driver: local
redis-data:
driver: local
prometheus-data:
driver: local
grafana-data:
driver: local
networks:
translator-network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16 |