-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
197 lines (194 loc) · 5.05 KB
/
docker-compose.yml
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
version: "3.9"
services:
postgresql:
image: "postgres:15.2-alpine"
restart: always
volumes:
- pgdata:/var/lib/postgresql/data
ports:
- "5432:5432"
environment:
POSTGRES_USER: athena
POSTGRES_PASSWORD: athena
POSTGRES_DB: athena
healthcheck:
test: ["CMD-SHELL", "pg_isready --dbname=postgresql://athena:athena@postgresql:5432/athena"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
redis:
image: "redis/redis-stack-server:latest"
restart: always
volumes:
- redisdata:/data
ports:
- "6379:6379"
environment:
REDIS_PASSWORD: athena
REDIS_ARGS: --requirepass athena
healthcheck:
test: [ "CMD-SHELL", "redis-cli -a athena --raw incr ping" ]
interval: 1s
timeout: 3s
retries: 5
start_period: 5s
nginx:
build:
context: .
target: nginx-stage
image: athena-nginx:latest
ports:
- "80:80"
depends_on:
api:
condition: service_healthy
restart: true
postgresql:
condition: service_healthy
restart: true
redis:
condition: service_healthy
x-develop:
watch:
- path: athena-app/package.json
action: rebuild
- path: athena-app/
target: /app
action: sync
api:
build:
context: .
target: python-stage
environment:
ATHENA_MODE: api
image: athena-api:latest
ports:
- "5000:5000"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/api/v1"]
interval: 30s
timeout: 5s
retries: 3
start_period: 5s
depends_on:
postgresql:
condition: service_healthy
restart: true
redis:
condition: service_healthy
restart: true
celery_beat:
condition: service_started
restart: true
celery_worker:
condition: service_started
restart: true
env_file:
- .env
x-develop:
watch:
- path: requirements.txt
action: rebuild
- path: athena/
target: /app/athena
action: sync
- path: plugins/
target: /app/plugins
action: sync
entrypoint: ["python", "-m", "athena.api"]
celery_beat:
build:
context: .
target: python-stage
environment:
- ATHENA_MODE=celery_beat
- CELERY_BROKER_URL=redis://:athena@redis:6379/0
- DATABASE_URL=postgresql://athena:athena@postgresql:5432/athena
depends_on:
postgresql:
condition: service_healthy
restart: true
redis:
condition: service_healthy
env_file:
- .env
x-develop:
watch:
- path: requirements.txt
action: rebuild
- path: athena/
target: /app/athena
action: sync
- path: plugins/
target: /app/plugins
action: sync
entrypoint: ["celery", "-A", "athena", "beat", "--loglevel=info"]
celery_worker:
build:
context: .
target: python-stage
environment:
- ATHENA_MODE=celery
- CELERY_BROKER_URL=redis://:athena@redis:6379/0
- DATABASE_URL=postgresql://athena:athena@postgresql:5432/athena
depends_on:
postgresql:
condition: service_healthy
restart: true
redis:
condition: service_healthy
env_file:
- .env
x-develop:
watch:
- path: requirements.txt
action: rebuild
- path: athena/
target: /app/athena
action: sync
- path: plugins/
target: /app/plugins
action: sync
entrypoint: ["celery", "-A", "athena", "worker", "--loglevel=info"]
fastchat-controller:
build:
context: .
dockerfile: Dockerfile-fastchat
environment:
ATHENA_MODE: api
image: athena-fastchat:latest
ports:
- "21001:21001"
entrypoint: ["python3", "-m", "fastchat.serve.controller", "--host", "0.0.0.0", "--port", "21001"]
fastchat-model-worker:
build:
context: .
dockerfile: Dockerfile-fastchat
volumes:
- huggingface:/root/.cache/huggingface
environment:
FASTCHAT_CONTROLLER_URL: http://fastchat-controller:21001
image: athena-fastchat:latest
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
entrypoint: ["python3", "-m", "fastchat.serve.model_worker", "--model-name", 'fastchat-t5-3b-v1.0', "--model-path", "lmsys/fastchat-t5-3b-v1.0", "--worker-address", "http://fastchat-model-worker:21002", "--controller-address", "http://fastchat-controller:21001", "--host", "0.0.0.0", "--port", "21002"]
fastchat-api-server:
build:
context: .
dockerfile: Dockerfile-fastchat
environment:
FASTCHAT_CONTROLLER_URL: http://fastchat-controller:21001
image: athena-fastchat:latest
ports:
- "8000:8000"
entrypoint: ["python3", "-m", "fastchat.serve.api", "--host", "0.0.0.0", "--port", "8000"]
volumes:
pgdata:
redisdata:
huggingface: