mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-01 09:02:26 +00:00
Yoann Piétri
43b6a2cdf2
Dockerfile and docker-compose files are now included in directory. They start a db, migrate, create a superuser if it doesn't already exists and start the server
20 lines
No EOL
582 B
Bash
Executable file
20 lines
No EOL
582 B
Bash
Executable file
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
cat docker/settings_local.template.py | envsubst > re2o/settings_local.py
|
|
|
|
AUTOMIGRATE=${AUTOMIGRATE:-yes}
|
|
|
|
if [ "$AUTOMIGRATE" != "skip" ]; then
|
|
python3 manage.py migrate --noinput
|
|
fi
|
|
|
|
cat <<EOF | python manage.py shell
|
|
from django.contrib.auth import get_user_model
|
|
|
|
User = get_user_model()
|
|
|
|
User.objects.filter(pseudo='$SUPERUSER_LOGIN').exists() or \
|
|
User.objects.create_superuser(pseudo='$SUPERUSER_LOGIN', email='$SUPERUSER_EMAIL', password='$SUPERUSER_PASS', surname='$SUPERUSER_LOGIN')
|
|
EOF
|
|
python manage.py runserver 0.0.0.0:8000 |