summaryrefslogtreecommitdiffstats
path: root/docker-entrypoint.sh
diff options
context:
space:
mode:
authorMatthew Lemon <y@yulqen.org>2024-06-05 14:48:08 +0100
committerMatthew Lemon <y@yulqen.org>2024-06-05 14:48:08 +0100
commit0fbdf05ebcc6641c2be4ecff8c466928ee37a899 (patch)
tree1b338a539aa1ed99cf3a534e631e9ee6ff88c605 /docker-entrypoint.sh
parent1f25aa672b8eeb4dc2929aeead940548d987a365 (diff)
Implement a try except in the entrypoint script
Diffstat (limited to 'docker-entrypoint.sh')
-rwxr-xr-xdocker-entrypoint.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh
index 1cf95db..899df63 100755
--- a/docker-entrypoint.sh
+++ b/docker-entrypoint.sh
@@ -1,6 +1,15 @@
#!/bin/sh
cd /app
+
+# Run migrations
python manage.py migrate
-python manage.py createsuperuser --noinput
+
+# Try to create a superuser, skip if email is already taken
+echo "Attempting to create superuser..."
+python manage.py createsuperuser --noinput || true
+
+# Collect static files
python manage.py collectstatic --noinput
+
+# Start Gunicorn
exec gunicorn --bind ':8080' --workers 3 ded.wsgi:application