Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
87 lines (74 loc) · 2.49 KB
/
Copy pathdocker-compose.yml
File metadata and controls
87 lines (74 loc) · 2.49 KB
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
# AI Voice Detection API - Docker Compose
# Usage: docker-compose up -d
services:
voice-detection-api:
build:
context: .
dockerfile: Dockerfile
container_name: voice-detection-api
restart: unless-stopped
ports:
- "${PORT:-8000}:8000"
environment:
# Gemini API Configuration
- GEMINI_API_KEY=${GEMINI_API_KEY}
- GEMINI_MODEL_LIGHT=${GEMINI_MODEL_LIGHT:-gemini-3-flash-preview}
- GEMINI_MODEL_HEAVY=${GEMINI_MODEL_HEAVY:-gemini-3-pro-preview}
# API Authentication
- API_SECRET_KEY=${API_SECRET_KEY}
# Server Configuration
- HOST=0.0.0.0
- PORT=8000
# Audio Processing
- MAX_AUDIO_DURATION_SECONDS=${MAX_AUDIO_DURATION_SECONDS:-30}
- AUDIO_SAMPLE_RATE=${AUDIO_SAMPLE_RATE:-16000}
# Rate Limiting
- RATE_LIMIT_REQUESTS=${RATE_LIMIT_REQUESTS:-30}
- RATE_LIMIT_WINDOW_SECONDS=${RATE_LIMIT_WINDOW_SECONDS:-60}
# Concurrency
- MAX_CONCURRENT_REQUESTS=${MAX_CONCURRENT_REQUESTS:-10}
- REQUEST_TIMEOUT_SECONDS=${REQUEST_TIMEOUT_SECONDS:-30}
# Retry
- MAX_RETRIES=${MAX_RETRIES:-3}
- BASE_RETRY_DELAY_SECONDS=${BASE_RETRY_DELAY_SECONDS:-1.0}
# Cache
- CACHE_MAX_SIZE=${CACHE_MAX_SIZE:-100}
- CACHE_TTL_SECONDS=${CACHE_TTL_SECONDS:-3600}
healthcheck:
test:
[
"CMD",
"python",
"-c",
"import urllib.request; urllib.request.urlopen('http://localhost:8000/api/health')",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# Resource limits
deploy:
resources:
limits:
cpus: "2"
memory: 8G
reservations:
cpus: "0.5"
memory: 256M
# Logging
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Optional: Add Redis for distributed caching (for multi-instance deployment)
# redis:
# image: redis:7-alpine
# container_name: voice-detection-redis
# restart: unless-stopped
# ports:
# - "6379:6379"
# volumes:
# - redis_data:/data
#volumes:
# redis_data: