Files
ireddocker/README.md
T
2020-08-07 12:23:03 +00:00

71 lines
2.1 KiB
Markdown

# IREDDOCKER
This is the iRedMail docker image with included external ldap authentication and ability of usage an external mysql database.
## Install
Clone git repository to local folder
```git clone https://gitlab.resds.ru/temasky/ireddocker.git```
## Configure
1. If you need to enable replication of mysql server, you need to run preconfigured mysql container.
To do this, create config file with parameters for mysql slave server:
```
cat <<EOF > slave.cnf
[mysqld]
server-id = 102
log_bin = /var/log/mysql/mysql-bin.log
relay-log = /var/log/mysql/mysql-relay-bin.log
binlog_do_db = amavisd
binlog_do_db = iredadmin
binlog_do_db = iredapd
binlog_do_db = roundcubemail
bind-address = 0.0.0.0
EOF
```
... and run container from this directory:
```docker run --name slave-mariadb -v ./slave.cnf:/etc/mysql/conf.d/slave.cnf -e MYSQL_ROOT_PASSWORD=(the sama password as in master server) -d -p 3306:3306 mariadb:latest```
1. add FQDN name in ```docker-compose.yml``` file
1. create file ```ireddocker/iredmail-env.conf```, like this:
```
cat <<EOF > ireddocker/iredmail-env.conf
LDAP_EXTERNAL_USE=YES
LDAP_EXTERNAL_SERVER=#ldap server address
LDAP_EXTERNAL_BINDPW=#bind password for ldap
LDAP_EXTERNAL_BINDUSER=#bind user for ldap
LDAP_EXTERNAL_BASE=#base dn for mail users
FIRST_DOMAIN=#mail domain name
MYSQL_MASTER_ADDRESS=#address of master server in case of replication
MYSQL_SLAVE_ADDRESS=#address of slsve server in case of replication
MYSQL_DATABASES="amavis iredadmin iredapd roundcubemail"
MYSQL_USE_REPLICTION=YES
MYSQL_EXTERNAL=YES#usage existing databse
MYSQL_ROOT_USER=#name for admin(root) user of external database
MYSQL_ROOT_PASSWD=#passwd for admin(root) user of external database
CUSTOM_CERT_USE=NO#usage of external cert file. If Yes - place certfile in cert_dir directory, in global catalog
CUSTOM_CERT_KEYFILE=privkey.pem
CUSTOM_CERT_CERTFILE=fullchain.pem
EOF
```
1. Create directory for mail and for certificates (default is ```mail_dir``` and ```cert_dir```. For other location this filder need to be change in ```docker-compose.yml``` file )
```
mkdir mail_dir
mkdir cert_dir
```
## RUN
```docker-compose up -d```