diff --git a/docker-compose.yml b/docker-compose.yml index 35a1b208..c05eb546 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,6 +2,8 @@ version: '3.8' services: app: + environment: + - DJANGO_SETTINGS_MODULE=mlarchive.settings.settings_docker build: context: . dockerfile: docker/app.Dockerfile diff --git a/docker/configs/docker_env b/docker/configs/docker_env index 83a97447..6aa035b0 100644 --- a/docker/configs/docker_env +++ b/docker/configs/docker_env @@ -1,6 +1,6 @@ # DJANGO SETTINGS DEBUG=True -SERVER_MODE=development +SERVER_MODE=development-localauth SECRET_KEY='j&-5nu4sa!dcg2gnkc8tr3($4$)6&i1(!$ju7v50+t-#6jyh7e' DATABASES_NAME=mailarch DATABASES_USER=django diff --git a/docker/configs/settings_docker.py b/docker/configs/settings_docker.py new file mode 100644 index 00000000..abc72490 --- /dev/null +++ b/docker/configs/settings_docker.py @@ -0,0 +1,5 @@ +# settings/settings_rebuild.py +from .base import * + +AUTHENTICATION_BACKENDS = ["django.contrib.auth.backends.ModelBackend"] + diff --git a/docker/scripts/app-init.sh b/docker/scripts/app-init.sh index dd5ab868..fd44f2ae 100755 --- a/docker/scripts/app-init.sh +++ b/docker/scripts/app-init.sh @@ -34,6 +34,14 @@ else fi fi +if [ ! -f "$WORKSPACEDIR/backend/mlarchive/settings/settings_docker.py" ]; then + echo "Setting up a default settings_docker.py ..." +else + echo "Renaming existing backend/mlarchive/settings/settings_docker.py to backend/mlarchive/settings/settings_docker.py.bak" + mv -f $WORKSPACEDIR/backend/mlarchive/settings/settings_docker.py $WORKSPACEDIR/backend/mlarchive/settings/settings_docker.py.bak +fi +cp $WORKSPACEDIR/docker/configs/settings_docker.py $WORKSPACEDIR/backend/mlarchive/settings/settings_docker.py + # Create data directories echo "Creating data directories..." for sub in \