Skip to content
This repository was archived by the owner on Jan 12, 2022. It is now read-only.

Commit 3c47a71

Browse files
committed
Add backup cron job and bump version
1 parent 88fb9a9 commit 3c47a71

6 files changed

Lines changed: 14 additions & 1 deletion

File tree

.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@ POSTFIX_TLS=
5050

5151
# Configure docker log driver - currently supports 'none', 'syslog' or 'journald'
5252
LOG_DRIVER=json-file
53+
54+
# Configure the moodle backup path
55+
MOODLE_BACKUP_ROOT=./backup

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [v0.1.15] - 2018-11-19
8+
### Added
9+
- Add customizable log driver option
10+
- Add postgres-backup container
11+
- Add host cron job for postgres backups
12+
- Add security label disable for selinux based systems
13+
714
## [v0.1.14] - 2018-11-08
815
### Added
916
- Bake in 'postfix' as default `smtphost`

dc.deb.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ services:
7070
- "/package/dc.prod-dbonly.yml=/etc/moodle-docker/"
7171
- "/package/docker-compose.yml=/etc/moodle-docker/"
7272
- "/package/systemd/moodle-docker.service=/lib/systemd/system/"
73+
- "/package/systemd/postgres-backup=/etc/cron.d/"
7374
environment:
7475
BUILD_VERSION: "${BUILD_VERSION}"
7576
MOODLE_VERSION: "${MOODLE_VERSION}"

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ services:
9393
depends_on:
9494
- "postgres"
9595
volumes:
96-
- ./backup:/backup:Z
96+
- ${MOODLE_BACKUP_ROOT}:/backup:Z
9797
environment:
9898
POSTGRES_PASSWORD: "${PGSQL_PASSWORD}"
9999
POSTGRES_USER: "${PGSQL_USER}"

systemd/postgres-backup

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0 * * * * root cd /etc/moodle-docker && /usr/local/bin/docker-compose --file /etc/moodle-docker/docker-compose.yml run postgres-backup /bin/backup_db

systemd/postinst.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ if [ ! -f /etc/moodle-docker/.env ]; then
4444
sed -i "s/MOODLE_ADMIN_PASS=.*/MOODLE_ADMIN_PASS=${moodle_admin_pass}/g" /etc/moodle-docker/.env
4545
sed -i "s/MOODLE_UPGRADE_KEY=.*/MOODLE_UPGRADE_KEY=${moodle_upgrade_key}/g" /etc/moodle-docker/.env
4646
sed -i "s/PGSQL_PASSWORD=.*/PGSQL_PASSWORD=${pgsql_password}/g" /etc/moodle-docker/.env
47+
sed -i "s#MOODLE_BACKUP_ROOT=.*#MOODLE_BACKUP_ROOT=/backups#g" /etc/moodle-docker/.env
4748
else
4849
echo "Nothing to do, .env already exists"
4950
fi

0 commit comments

Comments
 (0)