docker-compose.yml 1.6 KB
Newer Older
NJSun's avatar
NJSun 已提交
1 2 3 4 5
version: '3'
services:
  mysql:
    ## mysql version, you could get more tags at here : https://hub.docker.com/_/mysql?tab=tags
    image: "mysql:5.7"
S
sunnianjun 已提交
6
    ## default port is 3306, you could change to 33060 or any other port doesn't conflict MySQL on your OS
NJSun's avatar
NJSun 已提交
7
    ports:
8
      - "3306:3306"
NJSun's avatar
NJSun 已提交
9 10 11 12 13
    container_name: sharding-sphere-mysql
    ## launch mysql without password
    ## you could access the mysql in container by following command :
    ## docker exec -it sharding-sphere-mysql mysql -uroot
    environment:
S
sunnianjun 已提交
14
      - MYSQL_ALLOW_EMPTY_PASSWORD=yes
NJSun's avatar
NJSun 已提交
15
    ## if you insist to use password in mysql, remove MYSQL_ALLOW_EMPTY_PASSWORD=yes and uncomment following args
S
sunnianjun 已提交
16 17 18
    #  - MYSQL_ROOT_PASSWORD=root
    volumes:
      - ../../../src/resources/manual_schema.sql:/docker-entrypoint-initdb.d/manual_schema.sql
NJSun's avatar
NJSun 已提交
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

  zookeeper:
    ## get more versions of zookeeper here : https://hub.docker.com/_/zookeeper?tab=tags
    image: "zookeeper:3.4"
    ports: 
     - "2181:2181"
    container_name: sharding-sphere-zookeeper

  etcd:
    ## get more versions of etcd here  : https://quay.io/repository/coreos/etcd?tag=latest&tab=tags
    image: "quay.io/coreos/etcd:v3.3.12"
    ports: 
     - "2379:2379"
     - "2380:2380"
     - "4001:4001"
    container_name: sharding-sphere-etcd
    entrypoint: /usr/local/bin/etcd
    command:
     - '--advertise-client-urls=http://0.0.0.0:2379'
     - '--listen-client-urls=http://0.0.0.0:2379'
     - '--initial-advertise-peer-urls=http://0.0.0.0:2380'
     - '--listen-peer-urls=http://0.0.0.0:2380'
     - '--initial-cluster'
     - 'default=http://0.0.0.0:2380'