Add entrypoint to run migrations at start
This commit is contained in:
@@ -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"]
|
||||
|
||||
11
docker-entrypoint.sh
Normal file
11
docker-entrypoint.sh
Normal file
@@ -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 "$@"
|
||||
|
||||
Reference in New Issue
Block a user