diff --git a/.gitignore b/.gitignore index 489019ff..b89e8a7d 100644 --- a/.gitignore +++ b/.gitignore @@ -155,3 +155,5 @@ pyvenv.cfg # ADIT specific .dicoms +backups/* +!backups/.gitkeep diff --git a/backups/.gitkeep b/backups/.gitkeep new file mode 100644 index 00000000..896588f0 --- /dev/null +++ b/backups/.gitkeep @@ -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). diff --git a/compose/docker-compose.base.yml b/compose/docker-compose.base.yml index aba996a9..a28d9da2 100644 --- a/compose/docker-compose.base.yml +++ b/compose/docker-compose.base.yml @@ -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 @@ -27,7 +28,7 @@ services: hostname: init.local volumes: - web_data:/var/www/web - - /mnt:/mnt + - ../backups:/backups web: <<: *default-app @@ -36,7 +37,7 @@ services: context: .. volumes: - web_data:/var/www/web - - /mnt:/mnt + - ../backups:/backups postgres: image: postgres:13.16 diff --git a/example.env b/example.env index e29776f1..48087177 100644 --- a/example.env +++ b/example.env @@ -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