-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
188 lines (180 loc) · 4.98 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
version: '3'
services:
# http://localhost:9081/api
# http://localhost:9081/dashboard
traefik:
image: traefik:v2.9.6
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/traefik.docker.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
expose:
- 8000
environment:
- LOAD_BALANCER_CONFIG_FILE_PATH
- AUTHORIZATION_SECRET
working_dir: /usr/src/app
networks:
- athene
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
expose:
- 8000
environment:
- AUTHORIZATION_SECRET
- BALANCER_QUEUE_FREQUENCY
- BALANCER_GETTASK_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
expose:
- 8000
environment:
- DATABASE_HOST
- DATABASE_PORT
- DATABASE_NAME
- EMBEDDING_DATABASE_USER
- EMBEDDING_DATABASE_PWD
- AUTHORIZATION_SECRET
- BALANCER_QUEUE_FREQUENCY
- BALANCER_GETTASK_URL
- EMBEDDING_CHUNK_SIZE
- 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
expose:
- 8000
environment:
- DATABASE_HOST
- DATABASE_PORT
- DATABASE_NAME
- CLUSTERING_DATABASE_USER
- CLUSTERING_DATABASE_PWD
- AUTHORIZATION_SECRET
- BALANCER_QUEUE_FREQUENCY
- BALANCER_GETTASK_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
expose:
- 8000
environment:
- AUTHORIZATION_SECRET
- DATABASE_HOST
- DATABASE_PORT
- DATABASE_NAME
- TRACKING_DATABASE_USER
- TRACKING_DATABASE_PWD
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