Newer
Older
mailman-mailcow-integration / docker-compose.override.yml
version: '2.1'
services:

  postfix-mailcow:
    volumes:
      - ./data/mailman/core:/opt/mailman

  mailman-core:
    image: maxking/mailman-core:latest
    mem_limit: 1g
    hostname: mailman-core
    restart: always
    logging:
      driver: json-file
    volumes:
      - ./data/mailman/core:/opt/mailman/
    stop_grace_period: 30s
    links:
      - mailman-database:database
    depends_on:
      - mailman-database
      - postfix-mailcow
    environment:
      - TZ=${TZ}
      - MTA=postfix
      - DATABASE_URL=postgres://mailman:${MAILMAN_DB_PASSWORD}@database/mailmandb
      - DATABASE_TYPE=postgres
      - DATABASE_CLASS=mailman.database.postgresql.PostgreSQLDatabase
      - HYPERKITTY_API_KEY=${MAILMAN_HYPERKITTY_API_KEY}
    dns:
      - ${IPV4_NETWORK:-172.22.1}.254
    networks:
      mailcow-network:
        aliases:
          - mailman-core

  mailman-web:
    image: maxking/mailman-web:latest
    mem_limit: 512m
    container_name: mailman-web
    hostname: mailman-web
    restart: always
    logging:
      driver: json-file
    depends_on:
      - mailman-database
      - mailman-core
      - postfix-mailcow
    links:
      - mailman-core:mailman-core
      - mailman-database:database
    volumes:
      - ./data/mailman/web:/opt/mailman-web-data
    environment:
      - TZ=${TZ}
      - DATABASE_TYPE=postgres
      - DATABASE_URL=postgres://mailman:${MAILMAN_DB_PASSWORD}@database/mailmandb
      - HYPERKITTY_API_KEY=${MAILMAN_HYPERKITTY_API_KEY}
      - SECRET_KEY=${MAILMAN_SECRET_KEY}
      - SERVE_FROM_DOMAIN=${MAILMAN_SERVE_FROM_DOMAIN}
      - MAILMAN_ADMIN_USER=${MAILMAN_ADMIN_USER}
      - MAILMAN_ADMIN_EMAIL=${MAILMAN_ADMIN_EMAIL}
      - SMTP_HOST=${MAILCOW_HOSTNAME}
      - SMTP_PORT=${MAILMAN_SMTP_PORT:-587}
      - SMTP_HOST_USER=${MAILMAN_SMTP_HOST_USER}
      - SMTP_HOST_PASSWORD=${MAILMAN_SMTP_HOST_PASSWORD}
      - SMTP_USE_TLS=${MAILMAN_SMTP_USE_TLS:-true}
      - UWSGI_STATIC_MAP=/static=/opt/mailman-web-data/static
    ports:
      - ${MAILMAN_WEB_PORT:-127.0.0.1:8080}:8080
    dns:
      - ${IPV4_NETWORK:-172.22.1}.254
    networks:
      mailcow-network:
        aliases:
          - mailman-web

  mailman-database:
    image: postgres:12-alpine
    mem_limit: 1g
    restart: always
    environment:
      POSTGRES_DB: mailmandb
      POSTGRES_USER: mailman
      POSTGRES_PASSWORD: ${MAILMAN_DB_PASSWORD}
    volumes:
      - ./data/mailman/database:/var/lib/postgresql/data
    networks:
      mailcow-network:
        aliases:
          - mailman-database