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

Commit ff4cfb7

Browse files
committed
Add backup cron job and bump version
1 parent b8f0134 commit ff4cfb7

6 files changed

Lines changed: 14 additions & 2 deletions

File tree

.env

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
# Build version
3-
BUILD_VERSION=v0.1.13
3+
BUILD_VERSION=v0.1.14
44

55
# Moodle version
66
MOODLE_VERSION=3.5.2
@@ -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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ 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.14] - 2018-11-07
8+
- Add customizable log driver option
9+
- Add postgres-backup container
10+
- Add host cron job for postgres backups
11+
- Add security label disable for selinux based systems
12+
713
## [v0.1.13] - 2018-10-26
814
### Added
915
- Bake in Moodle Custom certificate plugin

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)