services:
  php:
    image: php:8.2.12-apache
    container_name: symfony_php
    ports:
      - "8000:80"
    volumes:
      - .:/var/www/html/
    working_dir: /var/www/html/
    command: bash -c "docker-php-ext-install pdo pdo_mysql && apache2-foreground"
    depends_on:
      - mysql  # Burada 'mysql' kullanmanız doğru.
    environment:
      - APACHE_DOCUMENT_ROOT=/var/www/html/public
  mysql:
    image: mysql:8.0
    container_name: symfony_mysql
    ports:
      - "3306:3306"
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: symfony_db
      MYSQL_USER: symfony_user
      MYSQL_PASSWORD: symfony_pass
    volumes:
      - mysql_data:/var/lib/mysql
      - ./docker/database_dump.sql:/docker-entrypoint-initdb.d/dump.sql

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: symfony_phpmyadmin
    restart: always
    ports:
      - 8081:80
    environment:
      PMA_HOST: mysql  # 'mysql' doğru şekilde burada da kullanılıyor.
      MYSQL_ROOT_PASSWORD: root
    depends_on:
      - mysql

volumes:
  mysql_data: