version: "3.5"
services:
  etcd:
    hostname: etcd1
    image: bitnami/etcd:3
    ports:
      - "2379:2379"
      - "2380:2380"
    user: root
    volumes:
      - "/var/docker/etcd/data:/opt/bitnami/etcd/data"
    environment:
      - "ETCD_ADVERTISE_CLIENT_URLS=http://10.0.5.15:2379"
      - "ETCD_LISTEN_CLIENT_URLS=http://0.0.0.0:2379"
      - "ETCD_LISTEN_PEER_URLS=http://0.0.0.0:2380"
      - "ETCD_INITIAL_ADVERTISE_PEER_URLS=http://10.0.5.15:2380"
      - "ALLOW_NONE_AUTHENTICATION=yes"
      - "ETCD_INITIAL_CLUSTER=node1=http://10.0.5.16:2380,node2=http://10.0.5.15:2380"
      - "ETCD_NAME=node2"
      - "ETCD_DATA_DIR=/opt/bitnami/etcd/data"
    networks:
      - app-net

networks:
  app-net:
    name: app-net