services:
  dovecot:
    image: dovecot/dovecot:2.3.21.1
    container_name: dovecot
    restart: unless-stopped
    ports:
      - "143:143"   # IMAP
      - "993:993"   # IMAPS
      - "110:110"   # POP3
      - "995:995"   # POP3S
    volumes:
      - ./config:/etc/dovecot
      - ./ssl:/etc/dovecot/ssl
      - ./mail:/var/mail
      - ./log:/var/log
      - ./entrypoint.sh:/entrypoint.sh  # Custom Entrypoint-Script
    environment:
      - UMASK=002         # Wird von unserem Entrypoint verwendet
    # entrypoint: ["/bin/sh", "/entrypoint.sh"]
    networks:
      - mail_network

networks:
  mail_network:
    driver: bridge