# Three 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 # docker compose --profile all-in-one up -d --build # mailserver + rspamd + redis (Bayes/greylisting) # # Every profile mounts exactly one volume — server_data/ — since every persistent thing # any of these processes own (mailgoserver's own data, rspamd's dbdir, redis's RDB # snapshot) lives under that single directory now; see the Dockerfiles' comments. # # All three default to the standard mail ports on the host (25/465/143/993) — the app # itself binds those directly (via a Linux file capability, not by running as root — see # the Dockerfiles), 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 it (see .env.example) — they'd # otherwise all 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/server_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/server_data mailserver-aio: build: context: .. dockerfile: docker-deploy/Dockerfile.aio container_name: mailgoserver-aio restart: unless-stopped profiles: ["all-in-one"] 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-aio-data:/app/server_data volumes: mailserver-data: mailserver-rspamd-data: mailserver-aio-data: