-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
156 lines (144 loc) · 3.66 KB
/
docker-compose.yaml
File metadata and controls
156 lines (144 loc) · 3.66 KB
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
version: '3.8'
services:
postgres:
image: postgres:15-alpine
container_name: query_intel_db
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.10.2
container_name: query_intel_es
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ports:
- "9200:9200"
volumes:
- es_data:/usr/share/elasticsearch/data
redis:
image: redis:7-alpine
container_name: query_intel_redis
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
minio:
image: minio/minio:latest
container_name: query_intel_cold_storage
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
ports:
- "9000:9000"
- "9001:9001"
command: server /data --console-address ":9001"
volumes:
- minio_data:/data
platform-gateway:
build: .
container_name: query_intel_gateway
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
expose:
- "8000"
environment:
- DATABASE_URL=${DATABASE_URL}
- REDIS_HOST=${REDIS_HOST}
- SHARD_COUNT=${SHARD_COUNT}
volumes:
- .:/app
restart: always
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 30s
timeout: 10s
retries: 3
platform-frontend:
image: nginx:alpine
container_name: query_intel_frontend
depends_on:
- platform-gateway
ports:
- "8000:80"
volumes:
- ./frontend:/usr/share/nginx/html:ro
- ./infrastructure/nginx.conf:/etc/nginx/nginx.conf:ro
restart: always
analysis-worker:
build: .
# No fixed container_name to allow horizontal scaling (e.g., --scale analysis-worker=3)
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
environment:
- REDIS_HOST=${REDIS_HOST}
- DATABASE_URL=${DATABASE_URL}
- ELATICSEARCH_URL=${ELASTICSEARCH_URL}
- SHARD_COUNT=${SHARD_COUNT}
volumes:
- .:/app
command: ["python3", "-m", "workers.worker"]
restart: always
deploy:
resources:
limits:
cpus: '1.0'
memory: 1G
healthcheck:
test: ["CMD", "python3", "-c", "import redis; r = redis.Redis(host='redis'); r.ping()"]
interval: 30s
timeout: 10s
retries: 3
dlm-archiver:
build: .
container_name: query_intel_archiver
depends_on:
- postgres
- minio
environment:
- DATABASE_URL=${DATABASE_URL}
- ACTIVE_TENANT=${ACTIVE_TENANT}
command: ["python3", "-m", "workers.archiver"]
profiles:
- utility
sentry-worker:
build: .
container_name: query_intel_sentry
network_mode: host
cap_add:
- NET_ADMIN
- NET_RAW
environment:
- DATABASE_URL=${HOST_DATABASE_URL}
- ACTIVE_TENANT=${ACTIVE_TENANT}
command: ["python3", "-m", "workers.sentry"]
restart: always
volumes:
postgres_data:
es_data:
minio_data: