# /docker-compose.yml
version: '3.8'

services:
  # 1. MailHog Service Definition
  mailhog:
    image: mailhog/mailhog:latest
    container_name: mailhog
    # MailHog listens on port 1025 for SMTP and 8025 for the Web UI
    ports:
      - "1025:1025" # SMTP Listener (where PHP will send mail)
      - "8025:8025" # Web UI (where you view the intercepted emails)
    restart: unless-stopped
    # Optional: If your PHP/Web server is in a different Docker container, 
    # you might need to connect them via a shared network.
    networks:
      - default

networks:
  default:
    driver: bridge