services:
  app:
    build:
      context: ..
      dockerfile: docker/php/dockerfile
    volumes:
      - ../src:/var/www/html
    working_dir: /var/www/html
    depends_on:
      - db

  nginx:
    image: nginx:1.25-alpine
    ports:
      - "8081:80"
    volumes:
      - ../src:/var/www/html
      - ../docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - app

  db:
    image: mysql:8.0
    env_file:
      - ../.env
    volumes:
      - db_data:/var/lib/mysql
      - ../docker/mysql/initdb:/docker-entrypoint-initdb.d
    ports:
      - "3307:3306"

volumes:
  db_data: