-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yaml
134 lines (129 loc) · 4.21 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
126
127
128
129
130
131
132
133
134
version: "3.5"
services:
setup:
image: eventstore/es-gencert-cli:1.0.2
entrypoint: bash
user: "root"
command: >
-c "mkdir -p ./certs
&& cd /certs
&& es-gencert-cli create-ca
&& es-gencert-cli create-node -out ./node1 -ip-addresses 127.0.0.1,172.30.240.11 -dns-names localhost
&& es-gencert-cli create-node -out ./node2 -ip-addresses 127.0.0.1,172.30.240.12 -dns-names localhost
&& es-gencert-cli create-node -out ./node3 -ip-addresses 127.0.0.1,172.30.240.13 -dns-names localhost
&& find . -type f -print0 | xargs -0 chmod 777"
container_name: setup
volumes:
- ./certs:/certs
node1.eventstore: &template
image: eventstore/eventstore:21.10.0-buster-slim
container_name: node1.eventstore
environment:
- EVENTSTORE_INT_IP=172.30.240.11
- EVENTSTORE_ADVERTISE_HTTP_PORT_TO_CLIENT_AS=2111
- EVENTSTORE_ADVERTISE_TCP_PORT_TO_CLIENT_AS=1111
- EVENTSTORE_GOSSIP_SEED=172.30.240.12:2113,172.30.240.13:2113
- EVENTSTORE_TRUSTED_ROOT_CERTIFICATES_PATH=/certs/ca
- EVENTSTORE_CERTIFICATE_FILE=/certs/node1/node.crt
- EVENTSTORE_CERTIFICATE_PRIVATE_KEY_FILE=/certs/node1/node.key
# from vars.env
- EVENTSTORE_CLUSTER_SIZE=3
- EVENTSTORE_RUN_PROJECTIONS=All
- EVENTSTORE_DISCOVER_VIA_DNS=false
- EVENTSTORE_ENABLE_EXTERNAL_TCP=true
- EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=true
- EVENTSTORE_ADVERTISE_HOST_TO_CLIENT_AS=127.0.0.1
healthcheck:
test:
[
"CMD-SHELL",
"curl --fail --insecure https://node1.eventstore:2113/health/live || exit 1",
]
interval: 5s
timeout: 5s
retries: 24
ports:
- 1111:1113
- 2111:2113
volumes:
- ./certs:/certs
depends_on:
- setup
restart: always
networks:
clusternetwork:
ipv4_address: 172.30.240.11
node2.eventstore:
<<: *template
container_name: node2.eventstore
environment:
- EVENTSTORE_INT_IP=172.30.240.12
- EVENTSTORE_ADVERTISE_HTTP_PORT_TO_CLIENT_AS=2112
- EVENTSTORE_ADVERTISE_TCP_PORT_TO_CLIENT_AS=1112
- EVENTSTORE_GOSSIP_SEED=172.30.240.11:2113,172.30.240.13:2113
- EVENTSTORE_TRUSTED_ROOT_CERTIFICATES_PATH=/certs/ca
- EVENTSTORE_CERTIFICATE_FILE=/certs/node2/node.crt
- EVENTSTORE_CERTIFICATE_PRIVATE_KEY_FILE=/certs/node2/node.key
# from vars.env
- EVENTSTORE_CLUSTER_SIZE=3
- EVENTSTORE_RUN_PROJECTIONS=All
- EVENTSTORE_DISCOVER_VIA_DNS=false
- EVENTSTORE_ENABLE_EXTERNAL_TCP=true
- EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=true
- EVENTSTORE_ADVERTISE_HOST_TO_CLIENT_AS=127.0.0.1
healthcheck:
test:
[
"CMD-SHELL",
"curl --fail --insecure https://node2.eventstore:2113/health/live || exit 1",
]
interval: 5s
timeout: 5s
retries: 24
ports:
- 1112:1113
- 2112:2113
networks:
clusternetwork:
ipv4_address: 172.30.240.12
node3.eventstore:
<<: *template
container_name: node3.eventstore
environment:
- EVENTSTORE_INT_IP=172.30.240.13
- EVENTSTORE_ADVERTISE_HTTP_PORT_TO_CLIENT_AS=2113
- EVENTSTORE_ADVERTISE_TCP_PORT_TO_CLIENT_AS=1113
- EVENTSTORE_GOSSIP_SEED=172.30.240.11:2113,172.30.240.12:2113
- EVENTSTORE_TRUSTED_ROOT_CERTIFICATES_PATH=/certs/ca
- EVENTSTORE_CERTIFICATE_FILE=/certs/node3/node.crt
- EVENTSTORE_CERTIFICATE_PRIVATE_KEY_FILE=/certs/node3/node.key
# from vars.env
- EVENTSTORE_CLUSTER_SIZE=3
- EVENTSTORE_RUN_PROJECTIONS=All
- EVENTSTORE_DISCOVER_VIA_DNS=false
- EVENTSTORE_ENABLE_EXTERNAL_TCP=true
- EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=true
- EVENTSTORE_ADVERTISE_HOST_TO_CLIENT_AS=127.0.0.1
healthcheck:
test:
[
"CMD-SHELL",
"curl --fail --insecure https://node3.eventstore:2113/health/live || exit 1",
]
interval: 5s
timeout: 5s
retries: 24
ports:
- 1113:1113
- 2113:2113
networks:
clusternetwork:
ipv4_address: 172.30.240.13
networks:
clusternetwork:
name: eventstoredb.local
driver: bridge
ipam:
driver: default
config:
- subnet: 172.30.240.0/24