version: '3.8'

services:
  web:
    build:
      context: .
      dockerfile: docker/php/Dockerfile
    container_name: web-panahan
    ports:
      - "8000:80"
    volumes:
      - ./:/var/www/html
    depends_on:
      - db
    networks:
      - app-network

  db:
    image: mysql:8.0
    container_name: db-panahan
    environment:
      MYSQL_DATABASE: panahan_turnament_new
      MYSQL_ROOT_PASSWORD: root
    ports:
      - "3306:3306"
    volumes:
      - db_data:/var/lib/mysql
      - ./docker/mysql/init.db:/docker-entrypoint-initdb.d
    networks:
      - app-network

networks:
  app-network:
    driver: bridge

volumes:
  db_data: