forked from ls1intum/Athena-CoFee
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
200 lines (192 loc) · 5.91 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
198
199
200
version: '3'
services:
# http://localhost:8081/api
# http://localhost:8081/dashboard
traefik:
image: traefik:v2.2.1
container_name: athene-traefik
restart: unless-stopped
depends_on:
# These components have API endpoints managed by traefik
- load-balancer
- embedding
- tracking
ports:
- ${TRAEFIK_DASHBOARD_PORT}:8080
- ${TRAEFIK_HTTP_PORT}:80
- ${TRAEFIK_HTTPS_PORT}:443
networks:
- athene
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./traefik.yml:/etc/traefik/traefik.yml
# http://localhost/queueStatus
# http://localhost/submit
# http://localhost/getTask
# http://localhost/sendTaskResult
load-balancer:
build:
context: .
dockerfile: ./load-balancer/Dockerfile
image: athene-load-balancer
container_name: athene-load-balancer
restart: unless-stopped
# ports:
# - 8000:8000
expose:
- 8000
environment:
- CONFIG_FILE_PATH=${LOAD_BALANCER_CONFIG_FILE_PATH}
- AUTHORIZATION_SECRET=${LOAD_BALANCER_AUTHORIZATION_SECRET}
working_dir: /usr/src/app
networks:
- athene
volumes:
- ./load-balance.yml:/usr/src/app/${LOAD_BALANCER_CONFIG_FILE_PATH}:ro
labels:
- traefik.enable=true
- traefik.http.routers.balancer.rule=Path(`/queueStatus`,`/submit`,`/getTask`,`/sendTaskResult`)
- traefik.http.routers.balancer.entrypoints=web
- traefik.http.routers.balancer-tls.rule=Path(`/queueStatus`,`/submit`,`/getTask`,`/sendTaskResult`)
- traefik.http.routers.balancer-tls.entrypoints=websecure
- traefik.http.routers.balancer-tls.tls=true
segmentation:
build:
context: .
dockerfile: ./segmentation/Dockerfile
image: athene-segmentation
container_name: athene-segmentation
restart: unless-stopped
depends_on:
- load-balancer
# ports:
# - 8001:8000
expose:
- 8000
environment:
- BALANCER_AUTHORIZATION_SECRET=${LOAD_BALANCER_AUTHORIZATION_SECRET}
- BALANCER_QUEUE_FREQUENCY=${BALANCER_QUEUE_FREQUENCY}
- BALANCER_GETTASK_URL=${BALANCER_GETTASK_URL}
- BALANCER_SENDRESULT_URL=${BALANCER_SENDRESULT_URL}
working_dir: /usr/src/app
networks:
- athene
labels:
- traefik.enable=true
# http://localhost/upload
# http://localhost/feedback_consistency
embedding:
build:
context: .
dockerfile: ./embedding/Dockerfile
image: athene-embedding
container_name: athene-embedding
restart: unless-stopped
depends_on:
- load-balancer
- database
# ports:
# - 8002:8000
expose:
- 8000
environment:
- DATABASE_HOST=${DATABASE_HOST}
- DATABASE_PORT=${DATABASE_PORT}
- DATABASE_NAME=${DATABASE_NAME}
- DATABASE_USER=${EMBEDDING_DATABASE_USER}
- DATABASE_PWD=${EMBEDDING_DATABASE_PWD}
- BALANCER_AUTHORIZATION_SECRET=${LOAD_BALANCER_AUTHORIZATION_SECRET}
- BALANCER_QUEUE_FREQUENCY=${BALANCER_QUEUE_FREQUENCY}
- BALANCER_GETTASK_URL=${BALANCER_GETTASK_URL}
- CHUNK_SIZE=${EMBEDDING_CHUNK_SIZE}
- BALANCER_SENDRESULT_URL=${BALANCER_SENDRESULT_URL}
working_dir: /usr/src/app
volumes:
- ${EMBEDDING_CLOUD_CONFIG_PATH}:/usr/src/app/src/cloud/config.py:ro
networks:
- athene
labels:
- traefik.enable=true
- traefik.http.routers.upload.rule=Path(`/upload`,`/feedback_consistency`)
- traefik.http.routers.upload.entrypoints=web
- traefik.http.routers.upload-tls.rule=Path(`/upload`,`/feedback_consistency`)
- traefik.http.routers.upload-tls.entrypoints=websecure
- traefik.http.routers.upload-tls.tls=true
clustering:
build:
context: .
dockerfile: ./clustering/Dockerfile
image: athene-clustering
container_name: athene-clustering
restart: unless-stopped
depends_on:
- load-balancer
- database
# ports:
# - 8003:8000
expose:
- 8000
environment:
- DATABASE_HOST=${DATABASE_HOST}
- DATABASE_PORT=${DATABASE_PORT}
- DATABASE_NAME=${DATABASE_NAME}
- DATABASE_USER=${CLUSTERING_DATABASE_USER}
- DATABASE_PWD=${CLUSTERING_DATABASE_PWD}
- BALANCER_AUTHORIZATION_SECRET=${LOAD_BALANCER_AUTHORIZATION_SECRET}
- BALANCER_QUEUE_FREQUENCY=${BALANCER_QUEUE_FREQUENCY}
- BALANCER_GETTASK_URL=${BALANCER_GETTASK_URL}
- BALANCER_SENDRESULT_URL=${BALANCER_SENDRESULT_URL}
working_dir: /usr/src/app
networks:
- athene
labels:
- traefik.enable=true
# http://localhost/tracking
tracking:
build:
context: .
dockerfile: ./tracking/Dockerfile
image: athene-tracking
container_name: athene-tracking
restart: unless-stopped
depends_on:
- database
# ports:
# - 8004:8000
expose:
- 8000
environment:
- JWT_SECRET_BASE64=YWVuaXF1YWRpNWNlaXJpNmFlbTZkb283dXphaVF1b29oM3J1MWNoYWlyNHRoZWUzb2huZ2FpM211bGVlM0VpcAo=
- DATABASE_HOST=database
- DATABASE_PORT=27017
- DATABASE_NAME=athene_db
- DATABASE_USER=tracking
- DATABASE_PWD=tracking_password
working_dir: /usr/src/app
networks:
- athene
labels:
- traefik.enable=true
- traefik.http.routers.tracking.rule=PathPrefix(`/tracking`)
- traefik.http.routers.tracking.entrypoints=web
- traefik.http.routers.tracking-tls.rule=PathPrefix(`/tracking`)
- traefik.http.routers.tracking-tls.entrypoints=websecure
- traefik.http.routers.tracking-tls.tls=true
database:
image: mongo:latest
container_name: athene-mongodb
restart: unless-stopped
expose:
- 27017
environment:
- MONGO_INITDB_DATABASE=${DATABASE_NAME}
- MONGO_INITDB_ROOT_USERNAME=${DATABASE_ROOT_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${DATABASE_ROOT_PASSWORD}
volumes:
- ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
- ./data/db:/data/db
networks:
- athene
networks:
athene:
driver: bridge