version: '3.8'

services:
  web:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: php_app
    volumes:
      - .:/var/www/html
    ports:
      - "8088:80"
    networks:
      - php_network
    depends_on:
      - db

  db:
    image: mysql:8.0.32
    container_name: php_db
    environment:
      MYSQL_ROOT_PASSWORD: root_password
      MYSQL_DATABASE: php_project
      MYSQL_USER: php_user
      MYSQL_PASSWORD: php_password
    volumes:
      - db_data:/var/lib/mysql
    ports:
      - "3308:3306"
    networks:
      - php_network

networks:
  php_network:
    driver: bridge

volumes:
  db_data:
    driver: local

