-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
143 lines (139 loc) · 4.64 KB
/
docker-compose.yml
File metadata and controls
143 lines (139 loc) · 4.64 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
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
services:
api:
build:
context: ./backend
args:
DOCKER_REGISTRY: ${DOCKER_REGISTRY:-}
APT_MIRROR: ${APT_MIRROR:-}
PYPI_INDEX_URL: ${PYPI_INDEX_URL:-}
ports:
- "5538:8000"
command: uvicorn app.main:app --host 0.0.0.0 --port 8000
volumes:
- ./uploads:/app/uploads
depends_on:
redis:
condition: service_healthy
environment:
- REDIS_URL=${REDIS_URL:-redis://redis:6379/0}
- VLM_API_KEY=${VLM_API_KEY:-}
- VLM_BASE_URL=${VLM_BASE_URL:-https://dashscope.aliyuncs.com/compatible-mode/v1}
- VLM_MODEL=${VLM_MODEL:-qwen-vl-plus}
- VOLCENGINE_ASR_API_KEY=${VOLCENGINE_ASR_API_KEY:-}
- TOS_AK=${TOS_AK:-}
- TOS_SK=${TOS_SK:-}
- TOS_BUCKET=${TOS_BUCKET:-mp3-srt}
- TOS_REGION=${TOS_REGION:-cn-beijing}
- TOS_ENDPOINT=${TOS_ENDPOINT:-tos-cn-beijing.volces.com}
- LLM_API_KEY=${LLM_API_KEY:-}
- LLM_API_BASE=${LLM_API_BASE:-}
- LLM_MODEL=${LLM_MODEL:-}
- LLM_TYPE=${LLM_TYPE:-openai}
- COMMERCE_GEMINI_API_KEY=${COMMERCE_GEMINI_API_KEY:-}
- COMMERCE_GEMINI_API_BASE=${COMMERCE_GEMINI_API_BASE:-}
- COMMERCE_GEMINI_MODEL=${COMMERCE_GEMINI_MODEL:-}
- COMMERCE_IMAGE_API_KEY=${COMMERCE_IMAGE_API_KEY:-}
- COMMERCE_IMAGE_API_BASE=${COMMERCE_IMAGE_API_BASE:-}
- COMMERCE_IMAGE_MODEL=${COMMERCE_IMAGE_MODEL:-}
- COMMERCE_IMAGE_SIZE=${COMMERCE_IMAGE_SIZE:-}
- COMMERCE_IMAGE_QUALITY=${COMMERCE_IMAGE_QUALITY:-}
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 30s
timeout: 5s
start_period: 15s
retries: 3
restart: unless-stopped
deploy:
resources:
limits:
memory: 2G
worker:
build:
context: ./backend
args:
DOCKER_REGISTRY: ${DOCKER_REGISTRY:-}
APT_MIRROR: ${APT_MIRROR:-}
PYPI_INDEX_URL: ${PYPI_INDEX_URL:-}
command: celery -A app.tasks.pipeline worker --loglevel=info --concurrency=1 --max-tasks-per-child=100 --max-memory-per-child=3000000 --prefetch-multiplier=1 -Ofair
volumes:
- ./uploads:/app/uploads
- model_cache:/root/.cache
shm_size: 512mb
ulimits:
nofile:
soft: 65536
hard: 65536
depends_on:
redis:
condition: service_healthy
environment:
- REDIS_URL=${REDIS_URL:-redis://redis:6379/0}
- VLM_API_KEY=${VLM_API_KEY:-}
- VLM_BASE_URL=${VLM_BASE_URL:-https://dashscope.aliyuncs.com/compatible-mode/v1}
- VLM_MODEL=${VLM_MODEL:-qwen-vl-plus}
- VOLCENGINE_ASR_API_KEY=${VOLCENGINE_ASR_API_KEY:-}
- TOS_AK=${TOS_AK:-}
- TOS_SK=${TOS_SK:-}
- TOS_BUCKET=${TOS_BUCKET:-mp3-srt}
- TOS_REGION=${TOS_REGION:-cn-beijing}
- TOS_ENDPOINT=${TOS_ENDPOINT:-tos-cn-beijing.volces.com}
- HF_ENDPOINT=${HF_ENDPOINT:-https://hf-mirror.com}
- APT_MIRROR=${APT_MIRROR:-}
- LLM_API_KEY=${LLM_API_KEY:-}
- LLM_API_BASE=${LLM_API_BASE:-}
- LLM_MODEL=${LLM_MODEL:-}
- LLM_TYPE=${LLM_TYPE:-openai}
- COMMERCE_GEMINI_API_KEY=${COMMERCE_GEMINI_API_KEY:-}
- COMMERCE_GEMINI_API_BASE=${COMMERCE_GEMINI_API_BASE:-}
- COMMERCE_GEMINI_MODEL=${COMMERCE_GEMINI_MODEL:-}
- COMMERCE_IMAGE_API_KEY=${COMMERCE_IMAGE_API_KEY:-}
- COMMERCE_IMAGE_API_BASE=${COMMERCE_IMAGE_API_BASE:-}
- COMMERCE_IMAGE_MODEL=${COMMERCE_IMAGE_MODEL:-}
- COMMERCE_IMAGE_SIZE=${COMMERCE_IMAGE_SIZE:-}
- COMMERCE_IMAGE_QUALITY=${COMMERCE_IMAGE_QUALITY:-}
healthcheck:
test: ["CMD", "python", "-c", "from celery import Celery; app = Celery('clipper', broker='${REDIS_URL:-redis://redis:6379/0}'); app.connection().ensure_connection(max_retries=2)"]
interval: 30s
timeout: 10s
start_period: 20s
retries: 3
restart: unless-stopped
deploy:
resources:
limits:
memory: 4G
frontend:
build:
context: ./frontend
args:
DOCKER_REGISTRY: ${DOCKER_REGISTRY:-}
NPM_REGISTRY: ${NPM_REGISTRY:-}
ports:
- "5537:80"
depends_on:
api:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:80/"]
interval: 30s
timeout: 5s
start_period: 10s
retries: 3
restart: unless-stopped
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
start_period: 5s
retries: 3
restart: unless-stopped
volumes:
redis_data:
model_cache: