Add entrypoint to run migrations at start
This commit is contained in:
parent
c97b06e07b
commit
53c6fad262
|
|
@ -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"]
|
||||
|
|
|
|||
|
|
@ -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 "$@"
|
||||
|
||||
Loading…
Reference in New Issue