forked from yashab-cyber/HackGpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
278 lines (264 loc) · 7.22 KB
/
docker-compose.yml
File metadata and controls
278 lines (264 loc) · 7.22 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
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
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
version: '3.8'
services:
# PostgreSQL Database
hackgpt-database:
image: postgres:15-alpine
container_name: hackgpt-db
restart: unless-stopped
environment:
POSTGRES_DB: hackgpt
POSTGRES_USER: hackgpt
POSTGRES_PASSWORD: hackgpt123
POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=C --lc-ctype=C"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
ports:
- "5432:5432"
networks:
- hackgpt-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U hackgpt -d hackgpt"]
interval: 30s
timeout: 10s
retries: 5
# Redis Cache
hackgpt-redis:
image: redis:7-alpine
container_name: hackgpt-redis
restart: unless-stopped
command: redis-server --appendonly yes --requirepass hackgpt123
volumes:
- redis_data:/data
- ./redis/redis.conf:/etc/redis/redis.conf:ro
ports:
- "6379:6379"
networks:
- hackgpt-network
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 30s
timeout: 10s
retries: 5
# HackGPT Main Application
hackgpt-app:
build:
context: .
dockerfile: Dockerfile
container_name: hackgpt-app
restart: unless-stopped
depends_on:
hackgpt-database:
condition: service_healthy
hackgpt-redis:
condition: service_healthy
environment:
- DATABASE_URL=postgresql://hackgpt:hackgpt123@hackgpt-database:5432/hackgpt
- REDIS_URL=redis://:hackgpt123@hackgpt-redis:6379/0
- OPENAI_API_KEY=${OPENAI_API_KEY}
- SECRET_KEY=${SECRET_KEY}
- LOG_LEVEL=INFO
- ENABLE_WEB_DASHBOARD=true
- ENABLE_API_SERVER=true
volumes:
- ./reports:/app/reports
- ./logs:/app/logs
- ./wordlists:/app/wordlists
- ./tools:/app/tools
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "8000:8000" # API Server
- "8080:8080" # Web Dashboard
networks:
- hackgpt-network
security_opt:
- seccomp:unconfined
cap_add:
- NET_ADMIN
- NET_RAW
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
interval: 30s
timeout: 10s
retries: 5
# Celery Worker for Background Tasks
hackgpt-worker:
build:
context: .
dockerfile: Dockerfile
container_name: hackgpt-worker
restart: unless-stopped
command: celery -A performance.parallel_processor worker --loglevel=info --concurrency=4
depends_on:
hackgpt-database:
condition: service_healthy
hackgpt-redis:
condition: service_healthy
environment:
- DATABASE_URL=postgresql://hackgpt:hackgpt123@hackgpt-database:5432/hackgpt
- REDIS_URL=redis://:hackgpt123@hackgpt-redis:6379/0
- OPENAI_API_KEY=${OPENAI_API_KEY}
- SECRET_KEY=${SECRET_KEY}
- LOG_LEVEL=INFO
volumes:
- ./reports:/app/reports
- ./logs:/app/logs
- ./wordlists:/app/wordlists
- ./tools:/app/tools
networks:
- hackgpt-network
deploy:
replicas: 2
# Celery Beat Scheduler
hackgpt-scheduler:
build:
context: .
dockerfile: Dockerfile
container_name: hackgpt-scheduler
restart: unless-stopped
command: celery -A performance.parallel_processor beat --loglevel=info
depends_on:
hackgpt-database:
condition: service_healthy
hackgpt-redis:
condition: service_healthy
environment:
- DATABASE_URL=postgresql://hackgpt:hackgpt123@hackgpt-database:5432/hackgpt
- REDIS_URL=redis://:hackgpt123@hackgpt-redis:6379/0
- OPENAI_API_KEY=${OPENAI_API_KEY}
- SECRET_KEY=${SECRET_KEY}
- LOG_LEVEL=INFO
volumes:
- ./logs:/app/logs
networks:
- hackgpt-network
# Prometheus Monitoring
prometheus:
image: prom/prometheus:latest
container_name: hackgpt-prometheus
restart: unless-stopped
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--storage.tsdb.retention.time=200h'
- '--web.enable-lifecycle'
networks:
- hackgpt-network
# Grafana Dashboard
grafana:
image: grafana/grafana:latest
container_name: hackgpt-grafana
restart: unless-stopped
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=hackgpt123
- GF_USERS_ALLOW_SIGN_UP=false
volumes:
- grafana_data:/var/lib/grafana
- ./monitoring/grafana/dashboards:/var/lib/grafana/dashboards
- ./monitoring/grafana/provisioning:/etc/grafana/provisioning
networks:
- hackgpt-network
depends_on:
- prometheus
# Elasticsearch for Logging
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
container_name: hackgpt-elasticsearch
restart: unless-stopped
environment:
- discovery.type=single-node
- ES_JAVA_OPTS=-Xms512m -Xmx512m
- xpack.security.enabled=false
- xpack.security.enrollment.enabled=false
volumes:
- elasticsearch_data:/usr/share/elasticsearch/data
ports:
- "9200:9200"
- "9300:9300"
networks:
- hackgpt-network
# Kibana for Log Visualization
kibana:
image: docker.elastic.co/kibana/kibana:8.11.0
container_name: hackgpt-kibana
restart: unless-stopped
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
ports:
- "5601:5601"
networks:
- hackgpt-network
depends_on:
- elasticsearch
# Consul for Service Discovery
consul:
image: consul:latest
container_name: hackgpt-consul
restart: unless-stopped
command: agent -server -bootstrap-expect=1 -ui -client=0.0.0.0 -data-dir=/consul/data
ports:
- "8500:8500"
- "8600:8600/udp"
volumes:
- consul_data:/consul/data
networks:
- hackgpt-network
# Nginx Reverse Proxy
nginx:
image: nginx:alpine
container_name: hackgpt-nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/ssl:/etc/nginx/ssl:ro
networks:
- hackgpt-network
depends_on:
- hackgpt-app
# Flower for Celery Monitoring
flower:
build:
context: .
dockerfile: Dockerfile
container_name: hackgpt-flower
restart: unless-stopped
command: celery -A performance.parallel_processor flower --port=5555 --broker=redis://:hackgpt123@hackgpt-redis:6379/0
ports:
- "5555:5555"
environment:
- REDIS_URL=redis://:hackgpt123@hackgpt-redis:6379/0
networks:
- hackgpt-network
depends_on:
- hackgpt-redis
volumes:
postgres_data:
driver: local
redis_data:
driver: local
prometheus_data:
driver: local
grafana_data:
driver: local
elasticsearch_data:
driver: local
consul_data:
driver: local
networks:
hackgpt-network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16