version: "3.8"
services:
  db:
    image: mysql:8.0
    container_name: bungalow_mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: symfony
      MYSQL_USER: symfony
      MYSQL_PASSWORD: symfony
    volumes:
      - db_data:/var/lib/mysql
    ports:
      - "3306:3306"

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: bungalow_phpmyadmin
    restart: always
    environment:
      PMA_HOST: db
      PMA_PORT: 3306
    ports:
      - "8080:80"
    depends_on:
      - db

  web:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: bungalow_symfony
    restart: always
    volumes:
      - .:/var/www/html
    ports:
      - "8000:8000"
    depends_on:
      - db

volumes:
  db_data:
