services:
  web:
    image: nginx:alpine
    container_name: nginx_server
    working_dir: /var/www
    ports:
      - "8080:80"
    volumes:
      - ./web_app:/var/www
      - ./.docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - app

  app:
    image: php_composer
    build:
      context: .
      dockerfile: symfony.dockerfile
    container_name: symfony_app
    working_dir: /var/www
    volumes:
      - ./web_app:/var/www
    environment:
      - APP_ENV=dev
    depends_on:
      - db

  db:
    image: mysql:9.2.0
    container_name: symfony_db
    environment:
      MYSQL_DATABASE: wishlist_db
      MYSQL_ROOT_PASSWORD: password
      MYSQL_USER: admin
      MYSQL_PASSWORD: admin_password
    ports:
      - "3306:3306"
    volumes:
      - ./mysql_data:/var/lib/mysql

  phpMyAdmin:
    image: phpmyadmin:5.2.2-apache
    container_name: phpMyAdmin
    ports:
    - "8081:80"
    environment:
      - MYSQL_ROOT_PASSWORD=password
      - MYSQL_USER=admin
      - MYSQL_PASSWORD=admin_password