services:

  mail:
    image: sympakaz:latest
    container_name: ${sympaServName}
    restart: ${restartPolicy}
    depends_on:
      - db
    networks:
      - sympaNet
      - jirafeauNet
    links:
      - db
    external_links:
      - db:${fileHost}
      - ${jirafeauServName}:${fileHost}
    ports:
      - ${SYMPA_IP}:25:25
      - ${SYMPA_IP}:443:443
    env_file:
      - ../../secret/env-${sympaServName}
    environment:
      - DOMAIN_SYMPA=${domain_sympa}
    volumes:
      - sympaLog:/var/log
      - sympaIcons:/usr/share/sympa/static_content/icons
      - sympaVar:/var/lib/sympa
      - sympaSpool:/var/spool/sympa
      - sympaPostfixSpool:/var/spool/postfix
      - sympaEtcMail:/etc/mail
      - filterConfig:/home/filter/config/
      - ./config/transport:/etc/postfix/transport:rw
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro
      - /etc/ssl:/etc/ssl:ro
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.sympa.rule=host(`listes.${domain}`)"
      - "traefik.docker.network=sympaNet"


  db:
    image: mariadb:10.5
    container_name: ${sympaDBName}
    restart: ${restartPolicy}
    networks:
      - sympaNet
    env_file:
      - ../../secret/env-${sympaDBName}
    volumes:
      - sympaDB:/var/lib/mysql
      - /home/sauve/:/svg/
      - /etc/localtime:/etc/localtime:ro
      - /etc/timezone:/etc/timezone:ro


volumes:
  sympaDB:
  sympaLog:
  sympaIcons:
  sympaVar:
  sympaSpool:
  sympaPostfixSpool:
  sympaEtcMail:
  filterConfig:
    external: true

networks:
  sympaNet:
    external: true
    name: sympaNet
  jirafeauNet:
    external: true
    name: jirafeauNet
