diff --git a/.dryrunsecurity.yaml b/.dryrunsecurity.yaml index da92963ddac..cca95d16109 100644 --- a/.dryrunsecurity.yaml +++ b/.dryrunsecurity.yaml @@ -52,6 +52,7 @@ sensitiveCodepaths: - 'docker/entrypoint-celery-beat.sh' - 'docker/entrypoint-celery-worker.sh' - 'docker/entrypoint-initializer.sh' + - 'docker/entrypoint-first-boot.sh' - 'docker/entrypoint-nginx.sh' - 'docker/entrypoint-uwsgi.sh' - 'docker/wait-for-it.sh' diff --git a/Dockerfile.django-alpine b/Dockerfile.django-alpine index 97bb4411796..cfef58fa32c 100644 --- a/Dockerfile.django-alpine +++ b/Dockerfile.django-alpine @@ -68,6 +68,7 @@ COPY \ docker/entrypoint-celery-beat.sh \ docker/entrypoint-celery-worker.sh \ docker/entrypoint-initializer.sh \ + docker/entrypoint-first-boot.sh \ docker/entrypoint-uwsgi.sh \ docker/entrypoint-uwsgi-dev.sh \ docker/entrypoint-unit-tests.sh \ diff --git a/Dockerfile.django-debian b/Dockerfile.django-debian index 26c27cad391..663a75e884d 100644 --- a/Dockerfile.django-debian +++ b/Dockerfile.django-debian @@ -71,6 +71,7 @@ COPY \ docker/entrypoint-celery-beat.sh \ docker/entrypoint-celery-worker.sh \ docker/entrypoint-initializer.sh \ + docker/entrypoint-first-boot.sh \ docker/entrypoint-uwsgi.sh \ docker/entrypoint-uwsgi-dev.sh \ docker/entrypoint-unit-tests.sh \ diff --git a/docker/entrypoint-first-boot.sh b/docker/entrypoint-first-boot.sh new file mode 100644 index 00000000000..ffc782b4ccc --- /dev/null +++ b/docker/entrypoint-first-boot.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# called from entrypoint-initializer.sh when no admin user exists (first boot) +cat </dev/null) ; do + echo "Loading $i" + python3 manage.py loaddata "${i%.*}" + done + + echo "Installing watson search index" + python3 manage.py installwatson + + # surveys fixture needs to be modified as it contains an instance dependant polymorphic content id + echo "Migration of textquestions for surveys" + python3 manage.py migrate_textquestions \ No newline at end of file diff --git a/docker/entrypoint-initializer.sh b/docker/entrypoint-initializer.sh index 08e77dc46ca..45a67105109 100755 --- a/docker/entrypoint-initializer.sh +++ b/docker/entrypoint-initializer.sh @@ -138,40 +138,8 @@ fi if [ -z "${ADMIN_EXISTS}" ] then -cat </dev/null) ; do - echo "Loading $i" - python3 manage.py loaddata "${i%.*}" - done - - echo "Installing watson search index" - python3 manage.py installwatson - - # surveys fixture needs to be modified as it contains an instance dependant polymorphic content id - echo "Migration of textquestions for surveys" - python3 manage.py migrate_textquestions - + . /entrypoint-first-boot.sh + create_announcement_banner initialize_data fi