-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
235 lines (226 loc) · 5.57 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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
services:
aiden_app:
build:
context: ./
dockerfile: ./aiden-web/Dockerfile
labels:
- "traefik.enable=true"
- "traefik.http.routers.aiden.rule=Host(`aiden.dev.localhost`)"
- "traefik.http.services.aiden.loadbalancer.server.port=8000"
networks:
- aiden_network
volumes:
- ./aiden-web/aiden_app:/app/aiden_app
- ./aiden-web/aiden_project:/app/aiden_project
- ./aiden-web/manage.py:/app/manage.py
- ./aiden-web/media:/app/media
env_file:
- .env
environment:
- DATABASE_URL=postgres://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME}
depends_on:
db:
condition: service_healthy
recommender:
condition: service_healthy
deploy:
resources:
limits:
memory: 1g
db:
image: postgres
environment:
- POSTGRES_DB=${DATABASE_NAME}
- POSTGRES_USER=${DATABASE_USER}
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data/
networks:
- aiden_network
ports:
- 5432:5432
expose:
- "5432"
healthcheck:
test:
[
"CMD",
"pg_isready",
"-U",
"${DATABASE_USER}",
"-d",
"${DATABASE_NAME}"
]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
memory: 512m
traefik:
image: "traefik:v2.9"
command:
- --entrypoints.web.address=:80
- --providers.docker=true
- --api.insecure # Don't do that in production
- --log
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
networks:
- aiden_network
deploy:
resources:
limits:
memory: 512m
pgweb:
image: sosedoff/pgweb
labels:
- "traefik.enable=true"
- "traefik.http.routers.pgweb.rule=Host(`pgweb.dev.localhost`)"
- "traefik.http.services.pgweb.loadbalancer.server.port=8081"
environment:
- PGWEB_DATABASE_URL=postgres://${DATABASE_USER}:${DATABASE_PASSWORD}@db:5432/${DATABASE_NAME}?sslmode=disable
- DATABASE_READ_ONLY=true
networks:
- aiden_network
depends_on:
db:
condition: service_healthy
deploy:
resources:
limits:
memory: 512m
qdrant:
image: qdrant/qdrant
labels:
- "traefik.enable=true"
- "traefik.http.routers.qdrant.rule=Host(`qdrant.dev.localhost`)"
- "traefik.http.services.qdrant.loadbalancer.server.port=6333" # Adjust port as needed
networks:
- aiden_network
environment:
- QDRANT_STORAGE_DIR=/qdrant/storage # Adjust path if needed
volumes:
- qdrant_data:/qdrant/storage
deploy:
resources:
limits:
memory: 4g
recommender:
build:
context: ./
dockerfile: ./aiden-recommender/Dockerfile
labels:
- "traefik.enable=true"
- "traefik.http.routers.recommender.rule=Host(`recommender.dev.localhost`)"
- "traefik.http.services.recommender.loadbalancer.server.port=8082"
networks:
- aiden_network
env_file:
- .env
volumes:
- ./aiden-recommender/aiden_recommender:/app/aiden_recommender
- ./.env:/app/.env
command:
[
"poetry",
"run",
"uvicorn",
"aiden_recommender.main:app",
"--host",
"0.0.0.0",
"--port",
"8082",
"--reload"
]
healthcheck:
test:
[
"CMD-SHELL",
"curl -f http://localhost:8082/health || exit 1"
]
interval: 10s
timeout: 5s
retries: 5
deploy:
replicas: 1
resources:
limits:
memory: 1g
depends_on:
qdrant:
condition: service_started
redis:
condition: service_healthy
redis:
image: redis:alpine
command:
[
"redis-server",
"--appendonly",
"no",
"--maxmemory",
"118mb",
"--maxmemory-policy",
"allkeys-lru"
]
networks:
- aiden_network
volumes:
- redis_data:/data
healthcheck:
test: [ "CMD-SHELL", "redis-cli ping" ]
interval: 10s
timeout: 5s
retries: 5
deploy:
replicas: 1
resources:
limits:
memory: 128M
minio:
image: minio/minio:latest
ports:
- 9000:9000
- 9001:9001
environment:
MINIO_ACCESS_KEY: ${AWS_ACCESS_KEY_ID}
MINIO_SECRET_KEY: ${AWS_SECRET_ACCESS_KEY}
labels:
- "traefik.enable=true"
- "traefik.http.routers.minio.rule=Host(`minio.dev.localhost`)"
- "traefik.http.services.minio.loadbalancer.server.port=9001"
command: server /data --console-address ":9001"
volumes:
- minio_data:/data
networks:
- aiden_network
# Just to initialize an empty media bucket at the start of minio
minio-client:
image: minio/mc:latest
entrypoint: >
/bin/sh -c "
/usr/bin/mc config host add --api s3v4 local ${AWS_S3_ENDPOINT_URL} ${AWS_ACCESS_KEY_ID} ${AWS_SECRET_ACCESS_KEY};
if ! /usr/bin/mc ls local/${AWS_STORAGE_BUCKET_NAME} >/dev/null 2>&1; then
/usr/bin/mc mb local/${AWS_STORAGE_BUCKET_NAME};
/usr/bin/mc anonymous set public local/${AWS_STORAGE_BUCKET_NAME};
else
echo 'Bucket already exists. Skipping creation.';
fi;
"
depends_on:
- minio
networks:
- aiden_network
volumes:
postgres_data:
qdrant_data:
redis_data:
minio_data:
networks:
aiden_network:
driver: bridge