2020-11-26 22:13:55 +08:00
|
|
|
version: '3.0'
|
|
|
|
|
2017-09-20 04:04:27 +08:00
|
|
|
services:
|
2020-11-26 22:13:55 +08:00
|
|
|
|
|
|
|
# Mail server running on separate image
|
2018-02-27 06:59:21 +08:00
|
|
|
mail:
|
|
|
|
image: tvial/docker-mailserver:latest
|
|
|
|
restart: always
|
2020-11-26 22:13:55 +08:00
|
|
|
domainname: example.com
|
2018-02-27 06:59:21 +08:00
|
|
|
volumes:
|
|
|
|
- maildata:/var/mail
|
|
|
|
- mailstate:/var/mail-state
|
2020-11-26 22:13:55 +08:00
|
|
|
- ./.docker/dev/mail/config/:/tmp/docker-mailserver/
|
2018-02-27 06:59:21 +08:00
|
|
|
environment:
|
|
|
|
- ENABLE_SPAMASSASSIN=0
|
|
|
|
- ENABLE_CLAMAV=0
|
|
|
|
- ENABLE_FAIL2BAN=0
|
|
|
|
- ENABLE_POSTGREY=0
|
|
|
|
- ENABLE_MANAGESIEVE=1
|
|
|
|
- ONE_DIR=1
|
|
|
|
- DMS_DEBUG=0
|
|
|
|
cap_add:
|
|
|
|
- NET_ADMIN
|
|
|
|
- SYS_PTRACE
|
2020-11-26 22:13:55 +08:00
|
|
|
|
|
|
|
# MySQL database
|
2018-02-27 06:59:21 +08:00
|
|
|
db:
|
|
|
|
image: mysql:5.7
|
|
|
|
hostname: db
|
|
|
|
restart: always
|
|
|
|
environment:
|
2020-11-26 22:13:55 +08:00
|
|
|
- MYSQL_ROOT_PASSWORD=root
|
|
|
|
- MYSQL_USER=snappymail
|
|
|
|
- MYSQL_PASSWORD=snappymail
|
|
|
|
- MYSQL_DATABASE=snappymail
|
2018-02-27 06:59:21 +08:00
|
|
|
volumes:
|
|
|
|
- mysql:/var/lib/mysql
|
2020-11-26 22:13:55 +08:00
|
|
|
|
|
|
|
# PHP FPM Server
|
2018-02-27 06:59:21 +08:00
|
|
|
php:
|
|
|
|
build:
|
2020-11-26 22:13:55 +08:00
|
|
|
context: ./.docker/dev/php
|
2018-02-27 06:59:21 +08:00
|
|
|
depends_on:
|
|
|
|
- db
|
|
|
|
- mail
|
|
|
|
volumes:
|
|
|
|
- ./:/var/www
|
2020-11-26 22:13:55 +08:00
|
|
|
- ./.docker/dev/php/snappymail.ini:/usr/local/etc/php/conf.d/snappymail.ini
|
|
|
|
|
|
|
|
# Nginx load balancer translating to PHP FPM
|
2018-02-27 06:59:21 +08:00
|
|
|
nginx:
|
|
|
|
image: nginx:latest
|
|
|
|
hostname: nginx
|
|
|
|
depends_on:
|
|
|
|
- php
|
|
|
|
ports:
|
2020-11-26 22:13:55 +08:00
|
|
|
- "${HTTPS_PORT}:443"
|
|
|
|
- "${HTTP_PORT}:80"
|
2018-03-07 03:26:43 +08:00
|
|
|
volumes:
|
|
|
|
- ./:/var/www
|
2020-11-26 22:13:55 +08:00
|
|
|
- ./.docker/dev/nginx/ssl:/etc/nginx/ssl
|
|
|
|
- ./.docker/dev/nginx/default.conf:/etc/nginx/conf.d/default.conf
|
2017-09-20 04:04:27 +08:00
|
|
|
|
2018-02-27 06:59:21 +08:00
|
|
|
volumes:
|
|
|
|
mysql:
|
|
|
|
driver: local
|
|
|
|
maildata:
|
|
|
|
driver: local
|
|
|
|
mailstate:
|
2020-11-26 22:13:55 +08:00
|
|
|
driver: local
|