Files
mailgoserver/docker-deploy/docker-compose.yml
T

56 lines
2.0 KiB
YAML

# Two independent setups, selected with --profile so they don't both start by accident:
#
# docker compose --profile standalone up -d --build # mailserver only
# docker compose --profile with-rspamd up -d --build # mailserver + rspamd, same container
#
# Both default to the standard mail ports on the host (25/465/143/993) — the app itself
# now binds those directly, no port remapping needed — plus port 80 (only actually used
# while Let's Encrypt HTTP-01 is enabled, see internal/webui's Let's Encrypt page) and
# the app's own non-privileged web ports (5000/5001; put a reverse proxy or your own
# 80/443 mapping in front of those if you want the dashboard on standard web ports too —
# note port 80 is already claimed here for HTTP-01 if you enable it). Only run one profile at a time
# unless you've overridden the host ports for one of them (see .env.example) — they'd
# otherwise both try to bind the same host ports.
services:
mailserver:
build:
context: ..
dockerfile: docker-deploy/Dockerfile
container_name: mailgoserver
restart: unless-stopped
profiles: ["standalone"]
ports:
- "${SMTP_PORT:-25}:25"
- "${SMTP_TLS_PORT:-465}:465"
- "${IMAP_PORT:-143}:143"
- "${IMAP_TLS_PORT:-993}:993"
- "${ACME_HTTP_PORT:-80}:80"
- "${WEB_HTTP_PORT:-5000}:5000"
- "${WEB_HTTPS_PORT:-5001}:5001"
volumes:
- mailserver-data:/app/data
mailserver-rspamd:
build:
context: ..
dockerfile: docker-deploy/Dockerfile.rspamd
container_name: mailgoserver-rspamd
restart: unless-stopped
profiles: ["with-rspamd"]
ports:
- "${SMTP_PORT:-25}:25"
- "${SMTP_TLS_PORT:-465}:465"
- "${IMAP_PORT:-143}:143"
- "${IMAP_TLS_PORT:-993}:993"
- "${ACME_HTTP_PORT:-80}:80"
- "${WEB_HTTP_PORT:-5000}:5000"
- "${WEB_HTTPS_PORT:-5001}:5001"
volumes:
- mailserver-rspamd-data:/app/data
- rspamd-data:/var/lib/rspamd
volumes:
mailserver-data:
mailserver-rspamd-data:
rspamd-data: