feat: self-hosted postfix
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
version: '3.8'
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
@@ -11,6 +10,37 @@ services:
|
||||
- '5432:5432'
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U newsletter"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
# Postfix mail server with OpenDKIM for self-hosted email
|
||||
postfix:
|
||||
build: ./docker/postfix
|
||||
container_name: newsletter-postfix
|
||||
restart: always
|
||||
# dns: Uses VPS default DNS. If MX lookups fail, uncomment and set explicit DNS:
|
||||
# - 213.186.33.99 # OVH DNS
|
||||
environment:
|
||||
- MAIL_DOMAIN=${MAIL_DOMAIN:-example.com}
|
||||
- MAIL_HOSTNAME=${MAIL_HOSTNAME:-mail.example.com}
|
||||
- DKIM_SELECTOR=${DKIM_SELECTOR:-mail}
|
||||
volumes:
|
||||
# Persist DKIM keys across container rebuilds
|
||||
- postfix-dkim:/etc/opendkim/keys
|
||||
# Persist mail queue
|
||||
- postfix-spool:/var/spool/postfix
|
||||
# Port 25 not exposed to host - only accessible within Docker network
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "echo 'QUIT' | nc -w 5 localhost 25 | grep -q '220' || exit 1"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
start_period: 10s
|
||||
retries: 3
|
||||
|
||||
volumes:
|
||||
postgres-data:
|
||||
postfix-dkim:
|
||||
postfix-spool:
|
||||
|
||||
Reference in New Issue
Block a user