Add Docker support with Gunicorn, SQLite volume persistence, and optional PostgreSQL
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
14
docker-entrypoint.sh
Normal file
14
docker-entrypoint.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -n "$DATABASE_URL" ]; then
|
||||
until PGPASSWORD="${POSTGRES_PASSWORD:-accounting_password}" psql -h "${DB_HOST:-accounting-db}" -U "${POSTGRES_USER:-accounting_user}" -d "${POSTGRES_DB:-accounting_db}" -c '\q' 2>/dev/null; do
|
||||
>&2 echo "PostgreSQL is unavailable - sleeping"
|
||||
sleep 1
|
||||
done
|
||||
>&2 echo "PostgreSQL is up"
|
||||
fi
|
||||
|
||||
python manage.py migrate --noinput
|
||||
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user