-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
131 lines (125 loc) · 3.08 KB
/
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
126
127
128
129
130
131
#version: '3.8'
services:
mongo:
build: mongodb/.
ports:
- '27017:27017'
environment:
MONGO_INITDB_ROOT_PASSWORD_FILE: /run/secrets/mongodb_root_password
MONGO_INITDB_ROOT_USERNAME_FILE: /run/secrets/mongodb_root_username
MONGO_INITDB_DATABASE: admin
MONGO_USERNAME_FILE: /run/secrets/mongodb_username
MONGO_PASSWORD_FILE: /run/secrets/mongodb_password
MONGO_DATABASE: iswars
secrets:
- mongodb_root_password
- mongodb_root_username
- mongodb_password
- mongodb_username
networks:
- islands
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/iswars --quiet
interval: 2s
timeout: 12s
retries: 5
start_period: 10s
volumes:
- ./mongodb/docker-entrypoint-initdb.d/:/docker-entrypoint-initdb.d/
command: [--auth]
redis:
build: redis/.
ports:
- '6379:6379'
environment:
REDIS_PASSWORD_FILE: /run/secrets/redis_password
REDIS_USERNAME_FILE: /run/secrets/redis_username
REDIS_DISABLE_DEFAULT_USER: true
secrets:
- redis_password
- redis_username
networks:
- islands
healthcheck:
test: ["CMD-SHELL", "redis-cli -u redis://$(cat /run/secrets/redis_username):$(cat /run/secrets/redis_password)@redis:6379 PING | grep -q PONG"]
interval: 2s
timeout: 12s
retries: 5
start_period: 10s
rabbitmq:
build: rmq/.
ports:
- '5672:5672'
environment:
RMQ_PASSWORD_FILE: /run/secrets/rmq_password
RMQ_USERNAME_FILE: /run/secrets/rmq_username
secrets:
- rmq_password
- rmq_username
networks:
- islands
healthcheck:
test: ["CMD-SHELL", "rabbitmq-diagnostics -q ping"]
interval: 2s
timeout: 12s
retries: 5
start_period: 10s
commons:
build: .
networks:
- islands
secrets:
- rmq_password
- rmq_username
- rmq_host
- rmq_port
- redis_password
- redis_host
- redis_port
- redis_username
- mongodb_password
- mongodb_username
- mongodb_host
- mongodb_port
- docker_host
depends_on:
mongo:
condition: service_healthy
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
networks:
islands:
driver: bridge
secrets:
rmq_password:
file: secrets/rmq_password
rmq_username:
file: secrets/rmq_username
rmq_host:
file: secrets/rmq_host
rmq_port:
file: secrets/rmq_port
redis_password:
file: secrets/redis_password
redis_host:
file: secrets/redis_host
redis_port:
file: secrets/redis_port
redis_username:
file: secrets/redis_username
mongodb_root_password:
file: secrets/mongodb_root_password
mongodb_root_username:
file: secrets/mongodb_root_username
mongodb_password:
file: secrets/mongodb_password
mongodb_username:
file: secrets/mongodb_username
mongodb_host:
file: secrets/mongodb_host
mongodb_port:
file: secrets/mongodb_port
docker_host:
file: secrets/docker_host