phase1: bootstrap containerized django stack and project scaffold

This commit is contained in:
Alfredo Di Stasio
2026-03-09 16:10:34 +01:00
parent 8cd65349c8
commit 35686bdb66
32 changed files with 655 additions and 1 deletions

21
entrypoint.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
set -e
echo "Waiting for PostgreSQL at ${POSTGRES_HOST}:${POSTGRES_PORT}..."
until pg_isready -h "${POSTGRES_HOST}" -p "${POSTGRES_PORT}" -U "${POSTGRES_USER}"; do
sleep 1
done
echo "PostgreSQL is available."
if [ "${AUTO_APPLY_MIGRATIONS:-0}" = "1" ] && [ "$1" = "gunicorn" ]; then
echo "Applying database migrations..."
python manage.py migrate --noinput
fi
if [ "${AUTO_COLLECTSTATIC:-0}" = "1" ] && [ "$1" = "gunicorn" ]; then
echo "Collecting static files..."
python manage.py collectstatic --noinput
fi
exec "$@"