-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
109 lines (98 loc) · 2.78 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
name: crack-hash-2
version: '3.4'
services:
rabbitmq:
image: rabbitmq:3.13-management-alpine
ports:
- "15672:15672"
- "5672:5672"
environment:
- RABBITMQ_DEFAULT_USER=rmuser
- RABBITMQ_DEFAULT_PASS=rmpassword
- RABBITMQ_DEFAULT_VHOST=crackHash
volumes:
- "rabbitmq_data:/var/lib/rabbitmq"
healthcheck:
test: [ "CMD", "rabbitmqctl", "status" ]
interval: 5s
timeout: 20s
retries: 5
#### Manager
manager:
build:
context: .
dockerfile: ./manager/Dockerfile
ports:
- "13001:8000"
environment:
- MANAGER_SERVER_HOST=0.0.0.0
- MANAGER_SERVER_PORT=8000
- MANAGER_MONGO_CONNSTR=mongodb://mongo1:27017,mongo2:27018,mongo3:27019/?replicaSet=rs0
- MANAGER_MONGO_DBNAME=CrackHash
- MANAGER_RABBITMQ_CONNSTR=amqp://rmuser:rmpassword@rabbitmq:5672/crackHash
- MANAGER_RABBITMQ_TASK_EXCHANGE=tasks
- MANAGER_RABBITMQ_RESULT_EXCHANGE=results
- MANAGER_RABBITMQ_RESULT_QUEUE=res_queue
depends_on:
rabbitmq:
condition: service_healthy
#### Workers
worker:
build:
context: .
dockerfile: ./worker/Dockerfile
deploy:
replicas: 2
environment:
- WORKER_RABBITMQ_CONNSTR=amqp://rmuser:rmpassword@rabbitmq:5672/crackHash
- WORKER_RABBITMQ_TASK_EXCHANGE=tasks
- WORKER_RABBITMQ_TASK_QUEUE=task_queue
- WORKER_RABBITMQ_RESULT_EXCHANGE=results
depends_on:
rabbitmq:
condition: service_healthy
#### MongoDB cluster
mongo1:
image: mongo:7.0
command: [ "--replSet", "rs0", "--bind_ip_all", "--port", "27017" ]
ports:
- "27017:27017"
environment:
- MONGO_INITDB_DATABASE=CrackHash
healthcheck:
test: echo "try { rs.status() } catch (err) { rs.initiate({_id:'rs0',members:[{_id:0,host:'mongo1:27017',priority:1},{_id:1,host:'mongo2:27018',priority:0.5},{_id:2,host:'mongo3:27019',priority:0.5}]}) }" | mongosh --port 27017 --quiet
interval: 5s
timeout: 30s
start_period: 0s
retries: 30
volumes:
- "mongo1_data:/data/db"
- "mongo1_config:/data/configdb"
mongo2:
image: mongo:7.0
command: [ "--replSet", "rs0", "--bind_ip_all", "--port", "27018" ]
ports:
- "27018:27018"
environment:
- MONGO_INITDB_DATABASE=CrackHash
volumes:
- "mongo2_data:/data/db"
- "mongo2_config:/data/configdb"
mongo3:
image: mongo:7.0
command: [ "--replSet", "rs0", "--bind_ip_all", "--port", "27019" ]
ports:
- "27019:27019"
environment:
- MONGO_INITDB_DATABASE=CrackHash
volumes:
- "mongo3_data:/data/db"
- "mongo3_config:/data/configdb"
volumes:
rabbitmq_data:
mongo1_data:
mongo2_data:
mongo3_data:
mongo1_config:
mongo2_config:
mongo3_config: