File tree 3 files changed +39
-1
lines changed
3 files changed +39
-1
lines changed Original file line number Diff line number Diff line change 11
11
APPS_DIR = BASE_DIR / "hesma"
12
12
env = environ .Env ()
13
13
14
- READ_DOT_ENV_FILE = env .bool ("DJANGO_READ_DOT_ENV_FILE" , default = False )
14
+ READ_DOT_ENV_FILE = env .bool ("DJANGO_READ_DOT_ENV_FILE" , default = True )
15
15
if READ_DOT_ENV_FILE :
16
16
# OS environment variables take precedence over variables from .env
17
17
env .read_env (str (BASE_DIR / ".env" ))
298
298
# Hydro data directory for storing larger files (e.g. snapshots)
299
299
HYDRO_DATA_DIR = env .str ("HYDRO_DATA_DIR" , default = "hydro_data/" )
300
300
hydro_fs = FileSystemStorage (location = HYDRO_DATA_DIR )
301
+
302
+ # Tracer data directory for storing larger files (e.g. snapshots)
303
+ TRACER_DATA_DIR = env .str ("TRACER_DATA_DIR" , default = "tracer_data/" )
304
+ tracer_fs = FileSystemStorage (location = TRACER_DATA_DIR )
305
+
306
+ # RT data directory for storing larger files (e.g. snapshots)
307
+ RT_DATA_DIR = env .str ("RT_DATA_DIR" , default = "rt_data/" )
308
+ rt_fs = FileSystemStorage (location = RT_DATA_DIR )
Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ services:
15
15
image : hesma_production_django
16
16
volumes :
17
17
- production_django_media:/app/hesma/media
18
+ - type : bind
19
+ source : /var/www/hesma_data
20
+ target : /data
18
21
depends_on :
19
22
- postgres
20
23
- redis
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
+ echo " Create database backup? (y/n)"
4
+ read answer
5
+ if [ " $answer " != " ${answer# [Yy]} " ] ; then
6
+ echo " Creating database backup..."
7
+ # Load the environment variables
8
+ source .envs/.production/.postgres
9
+
10
+ # Check if POSTGRES_BACKUP_DIR env var is set
11
+ if [ -z " $POSTGRES_BACKUP_DIR " ]; then
12
+ echo " POSTGRES_BACKUP_DIR is not set. Defaulting to ./backups"
13
+ backup_dir=" ./backups"
14
+ else
15
+ echo " POSTGRES_BACKUP_DIR is set to $POSTGRES_BACKUP_DIR "
16
+ backup_dir=$POSTGRES_BACKUP_DIR
17
+ fi
18
+
19
+ # Create the backup directory if it doesn't exist
20
+ if [ ! -d " $backup_dir " ]; then
21
+ mkdir -p $backup_dir
22
+ fi
23
+
24
+ # Backup the database
25
+ docker exec -t hesma_production_postgres pg_dumpall -c -U $POSTGRES_USER | gzip > $backup_dir /dump_` date +%Y-%m-%d" _" %H_%M_%S` .sql.gz
26
+
27
+ echo " Backup complete"
28
+ fi
29
+
3
30
echo " Shutting down the local cluster..."
4
31
docker compose -f production.yml down
5
32
You can’t perform that action at this time.
0 commit comments