8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-23 07:23:46 +00:00
re2o/docker/docker-entrypoint.sh

25 lines
796 B
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
set -euo pipefail
2024-03-03 10:44:43 +00:00
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
2024-03-08 07:15:49 +00:00
poetry run python manage.py migrate --noinput
fi
2024-03-08 09:05:24 +00:00
poetry run python manage.py collectstatic
poetry run python manage.py compilemessages
2024-03-03 10:44:43 +00:00
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
2024-03-08 08:55:50 +00:00
poetry run python manage.py runserver 0.0.0.0:8000