This repository has been archived on 2021-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
postfix-relay/compose.yml

45 lines
1.4 KiB
YAML

---
version: "3.8"
services:
app:
image: "boky/postfix"
networks:
- mail
- proxy
healthcheck:
test: [ "CMD", "sh", "-c", "netstat -an | fgrep 587 | fgrep -q LISTEN" ]
interval: 10s
timeout: 5s
start_period: 10s
retries: 2
environment:
FORCE_COLOR: "1"
TZ: ${TZ}
INBOUND_DEBUGGING: "${INBOUND_DEBUGGING:-0}"
ALLOWED_SENDER_DOMAINS: "${EXTRA_SENDER_DOMAINS} ${DOMAIN}"
POSTFIX_myhostname: "${DOMAIN}"
MASQUERADED_DOMAINS: "${MASQUERADED_DOMAINS}"
deploy:
restart_policy:
condition: on-failure
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.tcp.routers.${STACK_NAME}.entrypoints=smtp-submission"
- "traefik.tcp.routers.${STACK_NAME}.rule=HostSNI(`*`)"
# TODO 3wc: we can only route TCP traffic if it uses TLS
# https://doc.traefik.io/traefik/v2.0/routing/routers/#rule_1
#- "traefik.tcp.routers.${STACK_NAME}.rule=HostSNI(`${DOMAIN}`)"
- "traefik.tcp.routers.${STACK_NAME}.service=${STACK_NAME}"
- "traefik.tcp.services.${STACK_NAME}.loadbalancer.server.port=587"
#- "traefik.tcp.routers.${STACK_NAME}.tls.passthrough=true"
#- "traefik.tcp.routers.${STACK_NAME}.tls=true"
#- "traefik.tcp.routers.${STACK_NAME}.service=mailu_smtp"
networks:
mail:
external: true
proxy:
external: true