Moved cron tasks to another stack.
Added a second fetchmail. Moved image building to startup script. Moved volume management to startup script.
This commit is contained in:
parent
10fb8b003d
commit
9caefaa6d3
11
crontab
11
crontab
@ -1,11 +0,0 @@
|
|||||||
# /etc/crontab: system-wide crontab
|
|
||||||
# Unlike any other crontab you don't have to run the `crontab'
|
|
||||||
# command to install the new version when you edit this file
|
|
||||||
# and files in /etc/cron.d. These files also have username fields,
|
|
||||||
# that none of the other crontabs do.
|
|
||||||
|
|
||||||
SHELL=/bin/sh
|
|
||||||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
|
|
||||||
|
|
||||||
# m | h | day of month | month | day of week | user | command
|
|
||||||
30 0 * * * root docker -H tcp://127.0.0.1:2375 exec dovecot /root/dovecot_expire.sh > /proc/1/fd/2 2>&1
|
|
@ -4,7 +4,7 @@ services:
|
|||||||
|
|
||||||
dovecot:
|
dovecot:
|
||||||
image: dovecot:$VERSION_DOVECOT
|
image: dovecot:$VERSION_DOVECOT
|
||||||
build: "https://git.scimetis.net/yohan/docker-dovecot.git"
|
#build: "https://git.scimetis.net/yohan/docker-dovecot.git"
|
||||||
container_name: dovecot
|
container_name: dovecot
|
||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
@ -13,24 +13,34 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- mailnet
|
- mailnet
|
||||||
volumes:
|
volumes:
|
||||||
- mail_data:/home/yohan
|
- /mnt/volumes/mail_data/data:/home/yohan
|
||||||
- ./dovecot_expire.sh:/root/dovecot_expire.sh
|
- ./dovecot_expire.sh:/root/dovecot_expire.sh
|
||||||
- ./users:/etc/dovecot/users
|
- ./users:/etc/dovecot/users
|
||||||
- ./15-lda.conf:/etc/dovecot/conf.d/15-lda.conf
|
- ./15-lda.conf:/etc/dovecot/conf.d/15-lda.conf
|
||||||
|
|
||||||
fetchmail:
|
fetchmail-orange:
|
||||||
image: fetchmail:$VERSION_FETCHMAIL
|
image: fetchmail:$VERSION_FETCHMAIL
|
||||||
build: "https://git.scimetis.net/yohan/docker-fetchmail.git"
|
#build: "https://git.scimetis.net/yohan/docker-fetchmail.git"
|
||||||
container_name: fetchmail
|
container_name: fetchmail-orange
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- mailnet
|
- mailnet
|
||||||
volumes:
|
volumes:
|
||||||
- ./fetchmailrc:/etc/fetchmailrc
|
- ./fetchmailrc-orange:/etc/fetchmailrc
|
||||||
|
|
||||||
|
fetchmail-scimetis:
|
||||||
|
image: fetchmail:$VERSION_FETCHMAIL
|
||||||
|
#build: "https://git.scimetis.net/yohan/docker-fetchmail.git"
|
||||||
|
container_name: fetchmail-scimetis
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- mailnet
|
||||||
|
volumes:
|
||||||
|
- ./fetchmailrc-scimetis:/etc/fetchmailrc
|
||||||
|
|
||||||
feed2imap:
|
feed2imap:
|
||||||
image: feed2imap:$VERSION_FEED2IMAP
|
image: feed2imap:$VERSION_FEED2IMAP
|
||||||
build: "https://git.scimetis.net/yohan/docker-feed2imap.git"
|
#build: "https://git.scimetis.net/yohan/docker-feed2imap.git"
|
||||||
container_name: feed2imap
|
container_name: feed2imap
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
@ -38,20 +48,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./feed2imaprc:/root/feed2imaprc
|
- ./feed2imaprc:/root/feed2imaprc
|
||||||
|
|
||||||
cron-purge-dovecot:
|
|
||||||
image: cron:$VERSION_CRON
|
|
||||||
build: "https://git.scimetis.net/yohan/docker-cron.git"
|
|
||||||
restart: always
|
|
||||||
network_mode: "host"
|
|
||||||
volumes:
|
|
||||||
- ./crontab:/etc/crontab
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
|
|
||||||
mailnet:
|
mailnet:
|
||||||
external: true
|
external: true
|
||||||
|
|
||||||
volumes:
|
|
||||||
|
|
||||||
mail_data:
|
|
||||||
external: true
|
|
||||||
|
@ -6,14 +6,23 @@ secrets/docker-mail-stack/fetchmailrc-scimetis
|
|||||||
sudo chown root. fetchmailrc-orange fetchmailrc-scimetis users 15-lda.conf feed2imaprc
|
sudo chown root. fetchmailrc-orange fetchmailrc-scimetis users 15-lda.conf feed2imaprc
|
||||||
sudo chmod a-r feed2imaprc
|
sudo chmod a-r feed2imaprc
|
||||||
|
|
||||||
sudo chown root:root crontab
|
unset VERSION_DOVECOT VERSION_FETCHMAIL VERSION_FEED2IMAP
|
||||||
sudo chmod 644 crontab
|
VERSION_DOVECOT=$(git ls-remote https://git.scimetis.net/yohan/docker-dovecot.git| head -1 | cut -f 1|cut -c -10)
|
||||||
|
VERSION_FETCHMAIL=$(git ls-remote https://git.scimetis.net/yohan/docker-fetchmail.git| head -1 | cut -f 1|cut -c -10)
|
||||||
|
VERSION_FEED2IMAP=$(git ls-remote https://git.scimetis.net/yohan/docker-feed2imap.git| head -1 | cut -f 1|cut -c -10)
|
||||||
|
|
||||||
# --force-recreate is used to recreate container when crontab file has changed
|
rm -rf ~/build
|
||||||
unset VERSION_DOVECOT VERSION_FETCHMAIL VERSION_FEED2IMAP VERSION_CRON
|
mkdir -p ~/build
|
||||||
VERSION_DOVECOT=$(git ls-remote https://git.scimetis.net/yohan/docker-dovecot.git| head -1 | cut -f 1|cut -c -10) \
|
git clone https://git.scimetis.net/yohan/docker-dovecot.git ~/build/docker-dovecot
|
||||||
VERSION_FETCHMAIL=$(git ls-remote https://git.scimetis.net/yohan/docker-fetchmail.git| head -1 | cut -f 1|cut -c -10) \
|
sudo docker build -t dovecot:$VERSION_DOVECOT ~/build/docker-dovecot
|
||||||
VERSION_FEED2IMAP=$(git ls-remote https://git.scimetis.net/yohan/docker-feed2imap.git| head -1 | cut -f 1|cut -c -10) \
|
git clone https://git.scimetis.net/yohan/docker-fetchmail.git ~/build/docker-fetchmail
|
||||||
VERSION_CRON=$(git ls-remote https://git.scimetis.net/yohan/docker-cron.git| head -1 | cut -f 1|cut -c -10) \
|
sudo docker build -t fetchmail:$VERSION_FETCHMAIL ~/build/docker-fetchmail
|
||||||
|
git clone https://git.scimetis.net/yohan/docker-feed2imap.git ~/build/docker-feed2imap
|
||||||
|
sudo docker build -t feed2imap:$VERSION_FEED2IMAP ~/build/docker-feed2imap
|
||||||
|
VERSION_DOVECOT=$VERSION_DOVECOT \
|
||||||
|
VERSION_FETCHMAIL=$VERSION_FETCHMAIL \
|
||||||
|
VERSION_FEED2IMAP=$VERSION_FEED2IMAP \
|
||||||
sudo -E bash -c 'docker-compose up -d --force-recreate'
|
sudo -E bash -c 'docker-compose up -d --force-recreate'
|
||||||
|
# --force-recreate is used to recreate container when a file has changed
|
||||||
# /!\ We cannot remove the secrets files or restarting the container would become impossible.
|
# /!\ We cannot remove the secrets files or restarting the container would become impossible.
|
||||||
|
rm -rf ~/build
|
||||||
|
Loading…
Reference in New Issue
Block a user