Files
mail-roundcube/docker-compose.yml
2026-02-12 19:33:54 -03:00

101 lines
4.2 KiB
YAML

services:
db:
image: mariadb:${MYSQL_VERSION:-latest}
container_name: roundcube-db
environment:
MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD:? DB_PASSWORD is not set}
MARIADB_ROOT_HOST: localhost
MARIADB_MYSQL_LOCALHOST_USER: true
MARIADB_DATABASE: ${DB_NAME:-roundcubemail}
MARIADB_USER: ${DB_USER:-roundcubemail}
MARIADB_PASSWORD: ${DB_PASSWORD}
healthcheck:
test:
[
'CMD',
'/usr/local/bin/healthcheck.sh',
'--su-mysql',
'--connect',
'--innodb_initialized'
]
retries: 10
start_period: 20s
networks:
- backend
restart: unless-stopped
volumes:
- data:/var/lib/mysql
webmail:
image: git.mifi.dev/mifi-holdings/mail-roundcube:${IMAGE_TAG:-latest}
container_name: roundcube-webmail
environment:
ROUNDCUBEMAIL_DB_TYPE: ${DB_TYPE:-mysql}
ROUNDCUBEMAIL_DB_HOST: db
ROUNDCUBEMAIL_DB_NAME: ${DB_NAME:-roundcubemail}
ROUNDCUBEMAIL_DB_USER: ${DB_USER:-roundcubemail}
ROUNDCUBEMAIL_DB_PASSWORD: ${DB_PASSWORD:? DB_PASSWORD is not set}
ROUNDCUBEMAIL_DEFAULT_HOST: ${ROUNDCUBEMAIL_DEFAULT_HOST:? ROUNDCUBEMAIL_DEFAULT_HOST is not set}
ROUNDCUBEMAIL_DEFAULT_PORT: ${ROUNDCUBEMAIL_DEFAULT_PORT:? ROUNDCUBEMAIL_DEFAULT_PORT is not set}
ROUNDCUBEMAIL_SMTP_SERVER: ${ROUNDCUBEMAIL_SMTP_SERVER:? ROUNDCUBEMAIL_SMTP_SERVER is not set}
ROUNDCUBEMAIL_SMTP_PORT: ${ROUNDCUBEMAIL_SMTP_PORT:? ROUNDCUBEMAIL_SMTP_PORT is not set}
ROUNDCUBEMAIL_PLUGINS: ${ROUNDCUBEMAIL_PLUGINS}
ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE: ${ROUNDCUBEMAIL_UPLOAD_MAX_FILESIZE:-10M}
ROUNDCUBEMAIL_DES_KEY: ${ROUNDCUBEMAIL_DES_KEY:? ROUNDCUBEMAIL_DES_KEY is not set - must be 24 characters}
ROUNDCUBEMAIL_SUPPORT_URL: ${ROUNDCUBEMAIL_SUPPORT_URL:-}
ROUNDCUBEMAIL_MANAGESIEVE_HOST: ${ROUNDCUBEMAIL_MANAGESIEVE_HOST:-}
ROUNDCUBEMAIL_PASSWORD_DB_USER: ${ROUNDCUBEMAIL_PASSWORD_DB_USER:-}
ROUNDCUBEMAIL_PASSWORD_DB_PASSWORD: ${ROUNDCUBEMAIL_PASSWORD_DB_PASSWORD:-}
ROUNDCUBEMAIL_PASSWORD_DB_NAME: ${ROUNDCUBEMAIL_PASSWORD_DB_NAME:-postfix}
healthcheck:
test: curl --fail http://localhost || exit 1
retries: 5
start_period: 30s
networks:
- backend
- traefik
volumes:
- /var/run/mysqld/mysqld.sock:/var/run/mysqld/mysqld.sock:ro
- roundcube-keys:/etc/enigma/keys
- temp:/tmp/roundcube-temp
depends_on:
db:
condition: service_healthy
restart: unless-stopped
labels:
- 'traefik.enable=true'
- 'traefik.docker.network=traefik'
# Shared service
- 'traefik.http.services.webmail.loadbalancer.server.port=80'
# webmail.mifi.holdings
- 'traefik.http.routers.webmail.rule=Host(`webmail.mifi.holdings`)'
- 'traefik.http.routers.webmail.entrypoints=websecure'
- 'traefik.http.routers.webmail.middlewares=gzip@file,security-lax@file'
- 'traefik.http.routers.webmail.tls=true'
- 'traefik.http.routers.webmail.tls.certresolver=letsencrypt'
- 'traefik.http.routers.webmail.service=webmail'
# webmail.mylocalpro.biz
- 'traefik.http.routers.webmail-mylocalpro.rule=Host(`webmail.mylocalpro.biz`)'
- 'traefik.http.routers.webmail-mylocalpro.entrypoints=websecure'
- 'traefik.http.routers.webmail-mylocalpro.middlewares=gzip@file,security-lax@file'
- 'traefik.http.routers.webmail-mylocalpro.tls=true'
- 'traefik.http.routers.webmail-mylocalpro.tls.certresolver=letsencrypt'
- 'traefik.http.routers.webmail-mylocalpro.service=webmail'
networks:
backend:
external: false
traefik:
external: true
volumes:
data:
external: false
roundcube-keys:
external: true
temp:
external: false