version: '3.7'

services:

  consul-server:
    image: consul:1.15
    container_name: consul-server
    restart: always
    volumes:
     - ./server.json:/consul/config/server.json:ro
    networks:
      - consul
    ports:
      - "8500:8500"
      - "8600:8600/tcp"
      - "8600:8600/udp"
    command: "agent"

  consul-client:
    image: consul:1.15
    container_name: consul-client
    restart: always
    volumes:
     - ./client.json:/consul/config/client.json:ro
    networks:
      - consul
    command: "agent"

networks:
  consul:
    driver: bridge