vitess.io/vitess@v0.16.2/examples/compose/vtcompose/docker-compose.base.yml (about) 1 version: "2.1" 2 services: 3 consul1: 4 image: consul:latest 5 hostname: "consul1" 6 ports: 7 - "8400:8400" 8 - "8500:8500" 9 - "8600:8600" 10 command: "agent -server -bootstrap-expect 3 -ui -disable-host-node-id -client 0.0.0.0" 11 consul2: 12 image: consul:latest 13 hostname: "consul2" 14 expose: 15 - "8400" 16 - "8500" 17 - "8600" 18 command: "agent -server -retry-join consul1 -disable-host-node-id" 19 depends_on: 20 - consul1 21 consul3: 22 image: consul:latest 23 hostname: "consul3" 24 expose: 25 - "8400" 26 - "8500" 27 - "8600" 28 command: "agent -server -retry-join consul1 -disable-host-node-id" 29 depends_on: 30 - consul1 31 # This is a convenience container to quickly test vitess against an external database. 32 # In practice you will point Vitess to your existing database and migrate to a Vitess managed cluster. 33 external_db_host: 34 build: 35 context: ./external_db/mysql 36 dockerfile: Dockerfile 37 restart: always 38 environment: 39 MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-pass} 40 MYSQL_DATABASE: ${DB:-commerce} 41 MYSQL_USER: ${DB_USER:-external_db_user} 42 MYSQL_PASSWORD: ${DB_PASS:-external_db_password} 43 volumes: 44 - ./external_db/mysql/:/docker-entrypoint-initdb.d/ 45 - ./external_db/mysql/log:/var/log/mysql 46 command: 47 - --server-id=1 48 - --log-bin=mysql-bin 49 - --gtid_mode=ON 50 - --enforce_gtid_consistency 51 - --general_log=1 52 - --slow_query_log=1 53 healthcheck: 54 test: "/usr/bin/mysql --user=root --password=$${MYSQL_ROOT_PASSWORD} --execute \"SHOW DATABASES;\"" 55 timeout: 10s 56 retries: 10 57 ports: 58 - "3306"