forked from UIUC-Chatbot/ai-ta-backend
-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yaml
125 lines (119 loc) · 3.22 KB
/
docker-compose.yaml
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
services:
redis:
image: redis:7.2
restart: unless-stopped
container_name: redis
command: redis-server --requirepass ${INGEST_REDIS_PASSWORD}
# ports:
# - 6379:6379
networks:
- uiuc-chat-network
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "--raw", "ping"]
interval: 30s
timeout: 10s
retries: 3
qdrant:
image: qdrant/qdrant:v1.9.5
restart: unless-stopped
container_name: qdrant
# ports:
# - 6333:6333
# - 6334:6334
environment:
- QDRANT_API_KEY=${QDRANT_API_KEY}
volumes:
- ./qdrant_data:/qdrant/storage
- ./qdrant_config.yaml:/qdrant/config/production.yaml # Mount the config file directly as a volume
networks:
- uiuc-chat-network
healthcheck:
test:
[
"CMD",
"curl",
"-f",
"-H",
"Authorization: Bearer ${QDRANT_API_KEY}",
"http://qdrant:6333/health",
]
interval: 30s
timeout: 10s
retries: 3
minio:
image: minio/minio:RELEASE.2024-06-13T22-53-53Z
restart: unless-stopped
container_name: minio
# Customize env vars in .env file
environment:
MINIO_ROOT_USER: ${AWS_ACCESS_KEY_ID}
MINIO_ROOT_PASSWORD: ${AWS_SECRET_ACCESS_KEY}
command: server /data --address ":${DOCKER_INTERNAL_MINIO_API_PORT}" --console-address ":${DOCKER_INTERNAL_MINIO_DASHBOARD_PORT}"
ports:
- ${PUBLIC_MINIO_API_PORT}:${DOCKER_INTERNAL_MINIO_API_PORT}
- ${PUBLIC_MINIO_DASHBOARD_PORT}:${DOCKER_INTERNAL_MINIO_DASHBOARD_PORT}
networks:
- uiuc-chat-network
volumes:
- minio-data:/data
healthcheck:
test:
[
"CMD",
"curl",
"-f",
"http://minio:${DOCKER_INTERNAL_MINIO_API_PORT}/minio/health/live",
]
interval: 30s
timeout: 10s
retries: 3
flask-app:
build: . # Directory with Dockerfile for Flask app
# image: kastanday/ai-ta-backend:gunicorn
restart: unless-stopped
container_name: flask-app
ports:
- "${FLASK_PORT}:8000"
volumes:
- ./db:/usr/src/app/db # Mount local directory to store SQLite database
networks:
- uiuc-chat-network
depends_on:
- qdrant
- redis
- minio
healthcheck:
test: ["CMD", "curl", "-f", "http://flask-app:8000"]
interval: 30s
timeout: 10s
retries: 3
ingest-worker:
build: . # Use the same build context as the Flask app
command: python ai_ta_backend/redis_queue/worker.py
restart: unless-stopped
container_name: ingest-worker
networks:
- uiuc-chat-network
depends_on:
- redis
healthcheck:
test:
[
"CMD",
"python",
"-c",
"from redis import Redis; from rq import Worker; r = Redis(host='redis', port=6379, password='${INGEST_REDIS_PASSWORD}'); exit(0 if Worker.count(r) > 0 else 1)",
]
interval: 30s
timeout: 10s
retries: 3
# declare the network resource
# this will allow you to use service discovery and address a container by its name from within the network
networks:
uiuc-chat-network: {}
volumes:
redis-data: {}
qdrant-data: {}
minio-data: {}