services:
  web:
    build: .
    container_name: php_web
    ports:
      - "8080:80"
    volumes:
      - ./app:/var/www/html
    depends_on:
      - db
      - mailhog

  db:
    image: mysql:8.0
    container_name: mysql_db
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: cupon_phishing
      MYSQL_USER: cupon_phishing
      MYSQL_PASSWORD: SppFULKnXb7w4hN
    ports:
      - "3306:3306"
    volumes:
      - db_data:/var/lib/mysql

  mailhog:
    image: mailhog/mailhog
    container_name: mailhog
    ports:
      - "1025:1025"  # SMTP
      - "8025:8025"  # Web interface

volumes:
  db_data:
