services:
  # 1. Nginx Proxy Manager
  npm:
    image: 'jc21/nginx-proxy-manager:latest'
    container_name: npm-admin
    restart: unless-stopped
    ports:
      - '80:80'
      - '81:81'
      - '443:443'
    volumes:
      - ./npm/data:/data
      - ./npm/letsencrypt:/etc/letsencrypt
    networks:
      - default
      - mailcow-network

  # 2. 메인 홈페이지
  web-server:
    image: nginx:alpine
    container_name: hanmo-home
    restart: unless-stopped
    ports:
      - '8081:80'
    volumes:
      - ./html:/usr/share/nginx/html:ro
      - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
    networks:
      - default
      - mailcow-network

  # 3. 메일 연락처 핸들러
  mail-contact:
    build: .
    container_name: hanmo-mail-contact
    restart: unless-stopped
    ports:
      - '8001:8001'
    environment:
      - PYTHONUNBUFFERED=1
    command: python mail_contact.py
    networks:
      - default
      - mailcow-network

networks:
  default:
  mailcow-network:
    external: true
    name: mailcowdockerized_mailcow-network