Created
May 8, 2018 05:47
-
-
Save ponimas/d11298486044901562b7464f308c1a15 to your computer and use it in GitHub Desktop.
HOSTIP env var should be defined
This file contains hidden or 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
#HOSTIP=your.ip.addr.ess docker-compose up | |
version: '3.2' | |
services: | |
consul: | |
image: consul | |
ports: | |
- "8500:8500" | |
environment: | |
- SERVICE_8500_IGNORE=true | |
networks: | |
validators: | |
ipv4_address: 172.18.1.77 | |
command: agent -dev -client=172.18.1.77 -log-level=warn | |
registrator: | |
depends_on: | |
- consul | |
image: gliderlabs/registrator | |
networks: | |
validators: | |
volumes: | |
- type: bind | |
source: /var/run/docker.sock | |
target: /tmp/docker.sock | |
command: -ip=${HOSTIP} consul://consul:8500 | |
fabio: | |
depends_on: | |
- consul | |
- registrator | |
image: fabiolb/fabio | |
networks: | |
validators: | |
ipv4_address: 172.18.1.10 | |
ports: | |
- "9999:9999" | |
- "9998:9998" | |
environment: | |
- SERVICE_9999_IGNORE=true | |
- SERVICE_9998_IGNORE=true | |
command: | | |
/fabio -insecure=true | |
-registry.consul.addr consul:8500 | |
-proxy.strategy rr | |
-log.level=WARN | |
validator1: | |
depends_on: | |
- registrator | |
image: dbrain-exonum | |
ports: | |
- "9000" | |
- "8000" | |
environment: | |
- SERVICE_9000_NAME=exonum-private | |
- SERVICE_8000_NAME=exonum-public | |
- SERVICE_8000_TAGS=urlprefix-/public/ strip=/public | |
- SERVICE_9000_TAGS=urlprefix-/private/ strip=/private | |
- SERVICE_8000_CHECK_TCP=true | |
- SERVICE_9000_CHECK_TCP=true | |
- SERVICE_8000_CHECK_INTERVAL=15s | |
- SERVICE_9000_CHECK_INTERVAL=15s | |
networks: | |
validators: | |
ipv4_address: 172.18.1.1 | |
volumes: | |
- type: bind | |
source: ./tmp/config/config_1.toml | |
target: /config.toml | |
- type: bind | |
source: ./tmp/db/1 | |
target: /db | |
validator2: | |
depends_on: | |
- registrator | |
image: dbrain-exonum | |
ports: | |
- "9000" | |
- "8000" | |
environment: | |
- SERVICE_9000_NAME=exonum-private | |
- SERVICE_8000_NAME=exonum-public | |
- SERVICE_8000_TAGS=urlprefix-/public/ strip=/public | |
- SERVICE_9000_TAGS=urlprefix-/private/ strip=/private | |
- SERVICE_8000_CHECK_TCP=true | |
- SERVICE_9000_CHECK_TCP=true | |
- SERVICE_8000_CHECK_INTERVAL=15s | |
- SERVICE_9000_CHECK_INTERVAL=15s | |
networks: | |
validators: | |
ipv4_address: 172.18.1.2 | |
volumes: | |
- type: bind | |
source: ./tmp/config/config_2.toml | |
target: /config.toml | |
- type: bind | |
source: ./tmp/db/2 | |
target: /db | |
validator3: | |
depends_on: | |
- registrator | |
image: dbrain-exonum | |
ports: | |
- "9000" | |
- "8000" | |
environment: | |
- SERVICE_9000_NAME=exonum-private | |
- SERVICE_8000_NAME=exonum-public | |
- SERVICE_8000_TAGS=urlprefix-/public/ strip=/public | |
- SERVICE_9000_TAGS=urlprefix-/private/ strip=/private | |
- SERVICE_8000_CHECK_TCP=true | |
- SERVICE_9000_CHECK_TCP=true | |
- SERVICE_8000_CHECK_INTERVAL=15s | |
- SERVICE_9000_CHECK_INTERVAL=15s | |
networks: | |
validators: | |
ipv4_address: 172.18.1.3 | |
volumes: | |
- type: bind | |
source: ./tmp/config/config_3.toml | |
target: /config.toml | |
- type: bind | |
source: ./tmp/db/3 | |
target: /db | |
validator4: | |
depends_on: | |
- registrator | |
image: dbrain-exonum | |
ports: | |
- "9000" | |
- "8000" | |
environment: | |
- SERVICE_9000_NAME=exonum-private | |
- SERVICE_8000_NAME=exonum-public | |
- SERVICE_8000_TAGS=urlprefix-/public/ strip=/public | |
- SERVICE_9000_TAGS=urlprefix-/private/ strip=/private | |
- SERVICE_8000_CHECK_TCP=true | |
- SERVICE_9000_CHECK_TCP=true | |
- SERVICE_8000_CHECK_INTERVAL=15s | |
- SERVICE_9000_CHECK_INTERVAL=15s | |
networks: | |
validators: | |
ipv4_address: 172.18.1.4 | |
volumes: | |
- type: bind | |
source: ./tmp/config/config_4.toml | |
target: /config.toml | |
- type: bind | |
source: ./tmp/db/4 | |
target: /db | |
networks: | |
validators: | |
ipam: | |
config: | |
- subnet: 172.18.0.0/16 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment