ansible/roles/docker/templates/compose-files/mailu.yml.j2

143 lines
3.1 KiB
Plaintext
Raw Normal View History

# vim: ft=yaml.docker-compose
2023-12-10 17:04:50 +00:00
version: "3.8"
services:
postgres:
2023-12-10 17:04:50 +00:00
image: postgres:{{ services.mailu.postgres_version }}
restart: unless-stopped
environment:
POSTGRES_DB: mailu
POSTGRES_USER: mailu
POSTGRES_PASSWORD: "{{ postgres_passwords.mailu }}"
volumes:
- "./postgres:/var/lib/postgresql/data"
dns:
- "{{ services.mailu.dns }}"
redis:
2023-12-10 17:04:50 +00:00
image: redis:{{ services.mailu.redis_version }}
restart: unless-stopped
volumes:
- "./redis:/data"
depends_on:
- resolver
dns:
- "{{ services.mailu.dns }}"
front:
image: ghcr.io/mailu/nginx:{{ services.mailu.version }}
2023-12-10 17:04:50 +00:00
restart: unless-stopped
env_file: mailu.env
environment:
VIRTUAL_HOST: "{{ services.mailu.domain }}"
LETSENCRYPT_HOST: "{{ services.mailu.domain }}"
LETSENCRYPT_EMAIL: "{{ letsencrypt_email }}"
volumes:
- "./certs:/certs"
- "./overrides/nginx:/overrides:ro"
expose:
- "80"
ports:
- "25:25"
- "465:465"
2023-12-10 17:04:50 +00:00
- "587:587"
- "110:110"
- "995:995"
- "143:143"
- "993:993"
networks:
- default
2023-12-10 17:04:50 +00:00
- webmail
- external_services
2023-12-10 17:04:50 +00:00
depends_on:
- resolver
dns:
- "{{ services.mailu.dns }}"
resolver:
image: ghcr.io/mailu/unbound:{{ services.mailu.version }}
2023-12-10 17:04:50 +00:00
restart: unless-stopped
env_file: mailu.env
networks:
default:
ipv4_address: "{{ services.mailu.dns }}"
admin:
image: ghcr.io/mailu/admin:{{ services.mailu.version }}
2023-12-10 17:04:50 +00:00
restart: unless-stopped
env_file: mailu.env
volumes:
- "./data:/data"
- "./dkim:/dkim"
depends_on:
- redis
- resolver
dns:
- "{{ services.mailu.dns }}"
imap:
image: ghcr.io/mailu/dovecot:{{ services.mailu.version }}
2023-12-10 17:04:50 +00:00
restart: unless-stopped
env_file: mailu.env
volumes:
- "./mail:/mail"
- "./overrides/dovecot:/overrides:ro"
depends_on:
- front
- resolver
dns:
- "{{ services.mailu.dns }}"
smtp:
image: ghcr.io/mailu/postfix:{{ services.mailu.version }}
2023-12-10 17:04:50 +00:00
restart: unless-stopped
env_file: mailu.env
volumes:
- "./mailqueue:/queue"
- "./overrides/postfix:/overrides:ro"
depends_on:
- front
- resolver
dns:
- "{{ services.mailu.dns }}"
2023-12-10 17:04:50 +00:00
antispam:
image: ghcr.io/mailu/rspamd:{{ services.mailu.version }}
hostname: antispam
2023-12-10 17:04:50 +00:00
restart: unless-stopped
env_file: mailu.env
volumes:
- "./filter:/var/lib/rspamd"
2023-12-10 17:04:50 +00:00
- "./overrides/rspamd:/overrides:ro"
depends_on:
- front
2023-12-10 17:04:50 +00:00
- redis
- resolver
dns:
- "{{ services.mailu.dns }}"
webmail:
2023-12-10 17:04:50 +00:00
image: ghcr.io/mailu/webmail:{{ services.mailu.version }}
restart: unless-stopped
env_file: mailu.env
volumes:
- "./webmail:/data"
2023-12-10 17:04:50 +00:00
- "./overrides/snappymail:/overrides:ro"
networks:
- webmail
depends_on:
2023-12-10 17:04:50 +00:00
- front
networks:
default:
driver: bridge
ipam:
driver: default
config:
- subnet: "{{ services.mailu.subnet }}"
2023-12-10 17:04:50 +00:00
webmail:
driver: bridge
external_services:
external: true