ProyectoASIR/servermail/docker-compose.yml
2022-05-18 20:43:18 +02:00

89 lines
2.8 KiB
YAML

services:
mailserver:
image: docker.io/mailserver/docker-mailserver:latest
container_name: mailserver
# If the FQDN for your mail-server is only two labels (eg: example.com),
# you can assign this entirely to `hostname` and remove `domainname`.
hostname: mail.vergaracarmona.es
domainname: mail.vergaracarmona.es
env_file: mailserver.env
# More information about the mail-server ports:
# https://docker-mailserver.github.io/docker-mailserver/edge/config/security/understanding-the-ports/
# To avoid conflicts with yaml base-60 float, DO NOT remove the quotation marks.
ports:
- "25:25" # SMTP (explicit TLS => STARTTLS)
- "143:143" # IMAP4 (explicit TLS => STARTTLS)
- "465:465" # ESMTP (implicit TLS)
- "587:587" # ESMTP (explicit TLS => STARTTLS)
- "993:993" # IMAP4 (implicit TLS)
volumes:
- ./docker-data/dms/mail-data/:/var/mail/
- ./docker-data/dms/mail-state/:/var/mail-state/
- ./docker-data/dms/mail-logs/:/var/log/mail/
- ./docker-data/dms/config/:/tmp/docker-mailserver/
- /etc/localtime:/etc/localtime:ro
restart: always
stop_grace_period: 1m
cap_add:
- NET_ADMIN
- SYS_PTRACE
roundcubemail:
image: roundcube/roundcubemail:latest
container_name: roundcubemail
restart: unless-stopped
volumes:
- ./roundcube/www:/var/www/html
- ./roundcube/db/sqlite:/var/roundcube/db
ports:
- 9000:9000
environment:
- ROUNDCUBEMAIL_DB_TYPE=pgsql
- ROUNDCUBEMAIL_DB_HOST=roundcubedb # same as pgsql container name
- ROUNDCUBEMAIL_DB_NAME=NOMBRE_BD # same as pgsql POSTGRES_DB env name
- ROUNDCUBEMAIL_DB_USER=NOMBRE_USUARIO # same as pgsql POSTGRES_USER env name
- ROUNDCUBEMAIL_DB_PASSWORD=PASSWORD_USUARIO # same as pgsql POSTGRES_PASSWORD env name
- ROUNDCUBEMAIL_SKIN=elastic
- ROUNDCUBEMAIL_DEFAULT_HOST=tls://mail.DOMINIO
- ROUNDCUBEMAIL_SMTP_SERVER=tls://mail.DOMINIO
restart: always
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
- "traefik.http.routers.webmail-secure.entrypoints=websecure"
- "traefik.http.routers.webmail-secure.rule=Host(`webmail.DOMINIO`)"
- "traefik.http.services.webmail.loadbalancer.server.port=9000"
- "traefik.http.routers.me.tls.certresolver=mytlschallenge"
networks:
- mail
roundcubedb:
image: postgres:latest
container_name: roundcubedb
# restart: unless-stopped
ports:
- 5432:5432
volumes:
- ./db/postgres:/var/lib/postgresql/data
environment:
- POSTGRES_DB=NOMBRE_BD
- POSTGRES_USER=NOMBRE_USUARIO
- POSTGRES_PASSWORD=PASSWORD_USUARIO
networks:
- mail
networks:
- mail
- proxy
networks:
proxy:
external: true
mail: