Add database to filename, don't install recommends

Cron comes with just a metric ton of recommended dependencies including
mariadb-common which is just a bunch of unneccessary weight. Just
install what's necessary for cron.
This commit is contained in:
Joel Bradshaw 2021-12-28 14:17:23 -08:00
parent 879a410808
commit 2e9574d53c
2 changed files with 2 additions and 2 deletions

View file

@ -5,7 +5,7 @@ RUN mkdir /backups
COPY ./backup.sh /backups COPY ./backup.sh /backups
COPY ./weed.sh /backups COPY ./weed.sh /backups
COPY ./cronfile /etc/cron.d/cronfile COPY ./cronfile /etc/cron.d/cronfile
RUN apt-get update && apt-get -y install cron RUN apt-get update && apt-get -y --no-install-recommends install cron
RUN chmod 0644 /etc/cron.d/cronfile RUN chmod 0644 /etc/cron.d/cronfile
RUN crontab /etc/cron.d/cronfile RUN crontab /etc/cron.d/cronfile
RUN touch /var/log/cron.log RUN touch /var/log/cron.log

View file

@ -3,5 +3,5 @@ if [ -z "$POSTGRES_DB" ]; then
echo "Database not specified, defaulting to bookwyrm" echo "Database not specified, defaulting to bookwyrm"
fi fi
BACKUP_DB=${POSTGRES_DB:-bookwyrm} BACKUP_DB=${POSTGRES_DB:-bookwyrm}
filename=backup__$(date +%F) filename=backup_${BACKUP_DB}_$(date +%F)
pg_dump -U $BACKUP_DB > /backups/$filename.sql pg_dump -U $BACKUP_DB > /backups/$filename.sql