feat(backup): Added backup cron and helper script.

Backs up all of the data to the /backup dir.

MR !1
This commit is contained in:
2022-02-14 09:51:20 +09:30
parent 4db1b34d38
commit a7c1ae052c
3 changed files with 67 additions and 1 deletions

View File

@ -55,8 +55,14 @@ RUN chmod +x /docker-entrypoint.sh \
# Create vmail user for system
&& groupadd -g 5000 vmail \
&& useradd -g vmail -u 5000 vmail -d /var/vmail \
# Ensure Backup directory is created
&& mkdir /backup \
&& chown root:root /backup \
&& chmod 700 /backup \
# create SSL directory for ssl certificates
&& mkdir -p /ssl \
# Ensure scripts are executable
&& chmod +x /bin/backup.sh \
# Dovecot related commands
&& mkdir -p /srv/mail \
&& chown vmail:vmail /srv/mail \
@ -82,9 +88,10 @@ RUN chmod +x /docker-entrypoint.sh \
# Spammassassin related Commands
&& mkdir -p /var/spool/spamassassin \
&& chmod 777 /var/spool/spamassassin \
# Setup data volumes
VOLUME /srv/mail /ssl /var/spool/spamassassin /var/log
VOLUME /srv/mail /ssl /var/spool/spamassassin /backup /var/log
# Configure postfix
RUN postconf -e "maillog_file=/var/log/postfix.log" \