version: "3"
services:
  mysql:
    image: mariadb:10.5
    container_name: gameap_db
    hostname: gameap.db
    ports:
      - "127.0.0.1:13306:3306"
    environment:
      - MYSQL_ROOT_PASSWORD=gameapdbsuperduperpass
      - MYSQL_DATABASE=gameap
      - MYSQL_USER=gameap
      - MYSQL_PASSWORD=gameap
    restart: always
  nginx:
    image: nginx:latest
    container_name: gameap_nginx
    hostname: gameap.web
    ports:
      - "127.0.0.1:2080:80"
    volumes:
      - ./:/var/www
      - ./.dev/nginx-configs/default.conf:/etc/nginx/conf.d/default.conf
    restart: always
  php:
    build: ./.dev/docker/php
    container_name: gameap_php
    hostname: gameap.php
    volumes:
      - ./:/var/www
      - ./.dev/docker/php/zzz-config.ini:/usr/local/etc/php/conf.d/zzz-config.ini
    environment:
      DB_CONNECTION: mysql
      DB_HOST: db
      DB_DATABASE: gameap
      DB_USERNAME: gameap
      DB_PASSWORD: gameap
      XDEBUG_MODE: debug
      XDEBUG_CONFIG: "client_host=172.17.0.1 mode=debug start_with_request=yes idekey=PHPSTORM"
      PHP_IDE_CONFIG: "serverName=gameap-develop"
      ADMIN_PASSWORD: fpwPOuZD
      DAEMON_SETUP_TOKEN: test_auto_setup_token
    links:
      - mysql:db
    restart: always
    depends_on:
      - mysql
  daemon:
    build: ./.dev/docker/gdaemon
    container_name: gameap_daemon
    ports:
      - "127.0.0.1:2022:22"
    cap_add:
      - sys_ptrace
    restart: always
    links:
      - nginx:gameap
    depends_on:
      - php
      - nginx
      - mysql
