Skip to content

Commit

Permalink
🐳 [#135] add createinitialsuperuser into docker
Browse files Browse the repository at this point in the history
  • Loading branch information
annashamray committed Mar 26, 2024
1 parent 88da525 commit d9fa684
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions bin/docker_start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ if [ -d $fixtures_dir ]; then
done
fi

# Create superuser
# specify password by setting DJANGO_SUPERUSER_PASSWORD in the env
# specify username by setting OPENNOTIFICATIES_SUPERUSER_USERNAME in the env
# specify email by setting OPENNOTIF_SUPERUSER_EMAIL in the env
if [ -n "${OPENNOTIFICATIES_SUPERUSER_USERNAME}" ]; then
python src/manage.py createinitialsuperuser \
--no-input \
--username "${OPENNOTIFICATIES_SUPERUSER_USERNAME}" \
--email "${OPENNOTIFICATIES_SUPERUSER_EMAIL:-admin\@admin.org}"
unset OPENNOTIFICATIES_SUPERUSER_USERNAME OPENNOTIFICATIES_SUPERUSER_EMAIL DJANGO_SUPERUSER_PASSWORD
fi

# Start server
>&2 echo "Starting server"
exec uwsgi \
Expand Down

0 comments on commit d9fa684

Please sign in to comment.