services:
  database:
    image: mariadb:11.8
    container_name: wow-db
    environment:
      MARIADB_ROOT_PASSWORD: "${MYSQL_SUPERPASS}"      
    volumes:
      - ./database_data:/var/lib/mysql
      - ./config/database:/etc/mysql/conf.d:ro
    networks:
      - wow

  mangosd:
    image: wow-server-${WOW_VERSION}:runner
    container_name: wow-mangosd
    depends_on:
      - database
    environment:
      MANGOS_DBHOST: database
      MANGOS_DBUSER: "${MANGOS_DBUSER}"
      MANGOS_DBPASS: "${MANGOS_DBPASS}"
      TZ: "${WOW_TIMEZONE}"
    command: mangosd
    stdin_open: true
    tty: true
    ports:
      - "${MANGOSD_PORT:-8085}:8085"
      - "7878:7878"
    volumes:
      - ./mangosd_data:/var/lib/mangos:ro
      - ./config/mangosd:/opt/mangos/conf:ro
    networks:
      - wow

  realmd:
    image: wow-server-${WOW_VERSION}:runner
    container_name: wow-realmd
    depends_on:
      - database
    environment:
      MANGOS_DBHOST: database
      MANGOS_DBUSER: "${MANGOS_DBUSER}"
      MANGOS_DBPASS: "${MANGOS_DBPASS}"
      TZ: "${WOW_TIMEZONE}"
    command: realmd
    ports:
      - "${REALMD_PORT:-3724}:3724"
    volumes:
      - ./mangosd_data:/var/lib/mangos:ro
      - ./config/realmd:/opt/mangos/conf:ro
    networks:
      - wow

  phpmyadmin:
    image: phpmyadmin:5.2
    container_name: wow-db-admin
    depends_on:
      - database
    profiles:
      - debug
    environment:
      PMA_HOST: database
      PMA_USER: root
      PMA_PASSWORD: "${MYSQL_SUPERPASS}"
    networks:
      - wow
    ports:
      - "${PHPMYADMIN_PORT:-8080}:80"

  # admin:
  #   build: ./php
  #   ports:
  #     - "8089:80"
  #   env_file:
  #     - .env
  #   depends_on:
  #     - database
  #   networks:
  #     - wow

  php-panel:
    image: wow-registration
#    build: ./registration
    container_name: wow-registration
    ports:
      - "8090:80"
    environment:
      - SOAP_HOST=mangosd
      - SOAP_PORT=7878
    depends_on:
      - mangosd
    networks:
      - wow

networks:
  wow:
    driver: bridge