Created
January 10, 2022 04:43
-
-
Save lanekatris/0958d21df1d17ce1d7a95d4d69a7a656 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.5" | |
services: | |
setup: | |
image: eventstore/es-gencert-cli:1.0.2 | |
entrypoint: bash | |
user: "1000:1000" | |
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 666" | |
container_name: setup | |
volumes: | |
- ./certs:/certs | |
node1.eventstore: &template | |
image: eventstore/eventstore:20.10.2-buster-slim | |
container_name: node1.eventstore | |
env_file: | |
- vars.env | |
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 | |
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 | |
env_file: | |
- vars.env | |
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 | |
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 | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment