#To start the server from this docker-compose file you can run the command "docker-compose up"
#Configure the location of the configuration file and the data folder
#The connection to mysql should match the name of the service in this case "mysqldb"
version: "2.4"
services:
  mangosd:
    build:
      context: ..
      dockerfile: dockercontainer/DockerFile-mangosd
    depends_on:
      - mysqldb
    restart: always
    ports:
      - "8085:8085"
    stdin_open: true
    tty: true
    volumes:
#      - ./local/path/to/etc:/mangos/etc
#      - ./local/path/to/data:/mangos/data
      - ../../etc:/mangos/etc
      - ../../data:/mangos/data

  realmd:
    build:
      context: ..
      dockerfile: dockercontainer/DockerFile-realmd
    depends_on:
      - mysqldb
    restart: always
    ports:
      - "3724:3724"
    volumes:
#      - ./local/path/to/etc:/mangos/etc
      - ../../etc:/mangos/etc

  mysqldb:
    image: mysql:5.6
    restart: always
    environment:
      - MYSQL_USER=mangos
      - MYSQL_PASSWORD=mangos
      - MYSQL_ROOT_PASSWORD=mangos
      - MYSQL_ROOT_HOST=%
    ports:
      - "3306:3306"
    volumes:
#      - ./local/path/to/mysqldatabase:/var/lib/mysql
      - ../../dbdata:/var/lib/mysql
