Add Docker support with Gunicorn, SQLite volume persistence, and optional PostgreSQL

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Shayan Azadi
2026-07-01 00:32:25 +03:30
parent 066276743a
commit 5dd29c41d6
8 changed files with 151 additions and 3 deletions

14
docker-entrypoint.sh Normal file
View 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 "$@"