8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-16 08:23:12 +00:00
re2o/docker/docker-entrypoint.sh
2024-03-08 13:40:16 +01:00

34 lines
No EOL
1.1 KiB
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
<<<<<<< HEAD
=======
# cat docker/settings_local.template.py | envsubst > re2o/settings_local.py
cp docker/settings_local.template.py re2o/settings_local.py
>>>>>>> 33bacb65 (Add decouple)
cp -n cotisations/templates/cotisations/invoice.html templates/default_invoice.html
cp -n cotisations/templates/cotisations/voucher.html templates/default_voucher.html
AUTOMIGRATE=${AUTOMIGRATE:-yes}
if [ "$AUTOMIGRATE" != "skip" ]; then
<<<<<<< HEAD
poetry run python manage.py migrate --noinput
=======
poetry run python3 manage.py migrate --noinput
>>>>>>> a62566ef (premier essai)
fi
poetry run python manage.py collectstatic
poetry run python manage.py compilemessages
cat <<EOF | poetry run 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
poetry run python manage.py runserver 0.0.0.0:8000