This is the docker-compose configuration for my server at coldfix.de. You may adapt it to your purposes and use it for your own purposes. Note that this repository is put under the GPLv3.
git clone git@github.com:coldfix/server --recursive
cd server
docker-compose up
The mailserver requires some initial setup:
setup email and aliases using
./bin/mail-setup.sh [...]
, see setup.shcreate dkim keys:
./bin/mail-setup.sh config dkim
put netcup credentials in
./var/letsencrypt/netcup_credentials.ini
, see Credentialscreate DNS records, see Best Practices:
./bin/mail-setup-dns.sh \ create-mx-record \ create-spf-record \ create-dkim-record \ create-dmarc-record \ list-records
check DNS records using this DMARC Guide, an SPF Record Checker, and a DKIM Key Checker
docker-compose up will start the following sites/services:
- nginx with HTTP and HTTPS
- blog on coldfix.de
- sudoku on sudoku.coldfix.de
- gogs on gogs.coldfix.de
- murmur on coldfix.de:64738
- ejabberd on coldfix.de
- docker-mailserver on coldfix.de
See: https://docker-mailserver.github.io/docker-mailserver/edge/
letsencrypt cronjob is currently not run within docker container. You need to setup a cronjob like this manually:
# min hour dom mon dow cmd
0 5,21 * * * /home/server/bin/cert-renew.sh --wait 60 --quiet
Create backup:
docker exec server_ejabberd_1 /usr/local/sbin/ejabberdctl backup /opt/ejabberd/backup/ejabberd.backup
docker cp server_ejabberd_1:/opt/ejabberd/backup/ejabberd.backup /tmp/ejabberd.backup
Restore backup:
docker cp /tmp/ejabberd.backup server_ejabberd_1:/opt/ejabberd/backup/ejabberd.backup
docker exec server_ejabberd_1 /usr/local/sbin/ejabberdctl restore /opt/ejabberd/backup/ejabberd.backup
Create admin user:
docker exec server_ejabberd_1 \
/usr/local/sbin/ejabberdctl register admin coldfix.de "password"
Replace SSL certificate:
uid=$(docker exec server_ejabberd_1 id -u ejabberd)
gid=$(docker exec server_ejabberd_1 id -g ejabberd)
crt=$(pwd)/var/ssl/ejabberd.pem
cat /etc/letsencrypt/live/coldfix.de/{fullchain,privkey}.pem $crt
chown $uid:$gid $crt
chmod 700 $crt
docker restart server_ejabberd_1
- drop privileges in all containers