server-dotfiles/mail/docker-compose.yml

115 lines
2.3 KiB
YAML

---
version: '3.9'
services:
mail:
image: mailserver/docker-mailserver:12.1.0
hostname: ${HOSTNAME}
domainname: ${DOMAINNAME}
container_name: ${CONTAINER_NAME}
restart: unless-stopped
stop_grace_period: 2m30s # Avoid data loss
ports:
- "25:25"
- "143:143"
- "587:587"
- "993:993"
# - "127.0.0.1:1134:1134" # Only useful once we enable RSPAMD
volumes:
- maildata:/var/mail
- mailstate:/var/mail-state
- maillogs:/var/log/mail
- ./config/:/tmp/docker-mailserver/
- nginx_cert:/etc/letsencrypt/live/mail.poldebra.me
env_file:
- .env
- env-mailserver
cap_add:
- NET_ADMIN
- SYS_PTRACE
networks:
- internal
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
roundcubedb:
image: postgres:9.6-alpine
restart: unless-stopped
env_file:
- .env
- env-roundcube
volumes:
- rb_db:/var/lib/postgresql/data/
networks:
- internal
logging:
driver: "json-file"
options:
max-size: "5m"
max-file: "3"
roundcube:
image: roundcube/roundcubemail:1.6.x-apache
restart: unless-stopped
depends_on:
- mail
- roundcubedb
env_file:
- .env
- env-roundcube
volumes:
- rb_config:/var/roundcube/config/
networks:
- proxy
- internal
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
volumes:
maildata:
driver: local
driver_opts:
type: none
o: bind
device: "/srv/docker/mail/data"
mailstate:
driver: local
driver_opts:
type: none
o: bind
device: "/srv/docker/mail/state"
maillogs:
driver: local
driver_opts:
type: none
o: bind
device: "/srv/docker/mail/logs"
rb_config:
driver: local
driver_opts:
type: none
o: bind
device: "/srv/docker/mail/roundcube-config"
rb_db:
driver: local
driver_opts:
type: none
o: bind
device: "/srv/docker/mail/roundcube-db"
nginx_cert:
driver: local
driver_opts:
type: none
o: bind
device: "/srv/docker/reverse_proxy/certs/mail.poldebra.me"
networks:
proxy:
external: true
internal: