first commit

This commit is contained in:
2025-08-20 21:22:28 +00:00
commit 70d29f9f95
26 changed files with 2558 additions and 0 deletions

22
entrypoint.sh Normal file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail
# Ensure browsers are installed (the base image already has them, but this is safe)
python - <<'PY'
from pathlib import Path
from playwright.__main__ import main as pw
# no-op import ensures playwright is present; install step below is quick if cached
PY
# Run the app via gunicorn
# graceful-timeout - 300 ensures long page loads arent killed prematurely
# threads - 8 gives us more threads to work with
# gthread allows each worker to handle multiple threads, so async/blocking tasks like Playwright wont block the whole worker
exec gunicorn \
--bind 0.0.0.0:8000 \
--workers 2 \
--threads 8 \
--worker-class gthread \
--timeout 300 \
--graceful-timeout 300 \
"app.wsgi:app"