From 53c6fad262b436fad08b43891032b6422cdc34b2 Mon Sep 17 00:00:00 2001 From: KenwoodFox Date: Wed, 3 Dec 2025 18:54:30 -0500 Subject: [PATCH] Add entrypoint to run migrations at start --- Dockerfile | 5 +++++ docker-entrypoint.sh | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 docker-entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 2a8d2cd..879048b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,4 +14,9 @@ COPY . /app # Collect static files for WhiteNoise RUN python manage.py collectstatic --noinput +# Make entrypoint script executable +COPY docker-entrypoint.sh /docker-entrypoint.sh +RUN chmod +x /docker-entrypoint.sh + +ENTRYPOINT ["/docker-entrypoint.sh"] CMD ["gunicorn", "seduttomachineworks_project.wsgi:application", "--bind", "0.0.0.0:8000"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000..2ad7d6f --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e + +# Run migrations +echo "Running database migrations..." +python manage.py migrate --noinput + +# Start the application +echo "Starting application..." +exec "$@" +