Skip to content

Commit

Permalink
Improve handling of backups
Browse files Browse the repository at this point in the history
  • Loading branch information
medihack committed Oct 26, 2024
1 parent aeb31cd commit ac5d14d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,5 @@ pyvenv.cfg

# ADIT specific
.dicoms
backups/*
!backups/.gitkeep
4 changes: 4 additions & 0 deletions backups/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Directory to keep database backups

Database backups are done every night at 3 am by a periodic task using the dbbackup management command.
The dbbackup command can be called manually with `./manage.py dbbackup` (uses the django-dbbackup app).
7 changes: 4 additions & 3 deletions compose/docker-compose.base.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
x-app: &default-app
volumes:
- /mnt:/mnt
- ../backups:/backups
depends_on:
- postgres
environment:
USE_DOCKER: 1
PROJECT_VERSION: ${PROJECT_VERSION:-vX.Y.Z}
DATABASE_URL: "psql://postgres:postgres@postgres.local:5432/postgres"
BACKUP_DIR: "/backups"
DJANGO_STATIC_ROOT: "/var/www/web/static/"
ORTHANC1_HOST: "orthanc1.local"
ORTHANC1_HTTP_PORT: 6501
Expand All @@ -27,7 +28,7 @@ services:
hostname: init.local
volumes:
- web_data:/var/www/web
- /mnt:/mnt
- ../backups:/backups

web:
<<: *default-app
Expand All @@ -36,7 +37,7 @@ services:
context: ..
volumes:
- web_data:/var/www/web
- /mnt:/mnt
- ../backups:/backups

postgres:
image: postgres:13.16
Expand Down
1 change: 0 additions & 1 deletion example.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ ADMIN_USERNAME=admin
ADMIN_PASSWORD=mysecret
ADMIN_FULL_NAME="Wilhelm Roentgen"
ADMIN_EMAIL=wilhelm.roentgen@example.org
BACKUP_DIR=/mnt/backups
DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1
DJANGO_CSRF_TRUSTED_ORIGINS=
DJANGO_EMAIL_HOST=smtp.email.test
Expand Down

0 comments on commit ac5d14d

Please # to comment.