Files
SneakyScope/entrypoint.sh
2025-08-20 21:22:28 +00:00

23 lines
737 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/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"