docker-deploy/mail/v2/docker-compose.yml
2021-12-21 03:15:49 +08:00

83 lines
2.0 KiB
YAML

version: "3.9"
services:
mtaserver:
build:
context: ./docker
dockerfile: mta-postfix
image: esinio/mailserver:postfix-3.6.3
volumes:
- ./conf/postfix/main.cf:/etc/postfix/main.cf
- ./conf/postfix/master.cf:/etc/postfix/master.cf
- ./conf/postfix/pgsql:/etc/postfix/pgsql
ports:
- "10025:25"
- "10465:465"
mdaserver:
build:
context: ./docker
dockerfile: mda-dovecot
image: esinio/mailserver:dovecot-2.3.17.1
volumes:
- ./conf/dovecot:/etc/dovecot
ports:
- 10143:143
- 10993:993
# command:
# - dovecot -F
dkimserver:
build:
context: ./docker
dockerfile: opendkim
image: esinio/mailserver:opendkim-2.11.0
volumes:
- ./conf/opendkim:/etc/opendkim
# command:
# - opendkim
# - -f
# - -l
webmail:
image: roundcube/roundcubemail
environment:
- ROUNDCUBEMAIL_DEFAULT_HOST=mdaserver
- ROUNDCUBEMAIL_DEFAULT_PORT=143
- ROUNDCUBEMAIL_SMTP_SERVER=mtaserver
- ROUNDCUBEMAIL_SMTP_PORT=25
ports:
- 8000:80
links:
- mdaserver
- mtaserver
depends_on:
- mdaserver
- mtaserver
- dbserver
dbserver:
image: postgres:14.1-alpine
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- ./data/postgresql:/var/lib/postgresql/data
ports:
- 15432:5432
postfixadmin:
image: postfixadmin:3.3.10-apache
environment:
- POSTFIXADMIN_SETUP_PASSWORD=${POSTFIXADMIN_SETUP_PASSWORD}
- POSTFIXADMIN_DB_TYPE=pgsql
- POSTFIXADMIN_DB_HOST=dbserver
- POSTFIXADMIN_DB_USER=${POSTGRES_USER}
- POSTFIXADMIN_DB_PASSWORD=${POSTGRES_PASSWORD}
- POSTFIXADMIN_DB_NAME=postfix
- POSTFIXADMIN_SMTP_SERVER=${POSTFIXADMIN_SMTP_SERVER}
- POSTFIXADMIN_SMTP_PORT=${POSTFIXADMIN_SMTP_PORT}
restart: unless-stopped
ports:
- 8080:80
links:
- dbserver
- mtaserver
depends_on:
- dbserver