From af0c7f0b4b3c96a32eb17f2110c00adee9c4a502 Mon Sep 17 00:00:00 2001 From: Eran Barkai Date: Thu, 4 Dec 2025 15:09:11 +0200 Subject: [PATCH] Add native Heroku deployment (non-Docker) - switch from container to buildpack --- Procfile | 2 ++ pr_agent/servers/gunicorn_config.py | 4 +++- runtime.txt | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 Procfile create mode 100644 runtime.txt diff --git a/Procfile b/Procfile new file mode 100644 index 00000000..4bcf3206 --- /dev/null +++ b/Procfile @@ -0,0 +1,2 @@ +web: python -m gunicorn -k uvicorn.workers.UvicornWorker -c pr_agent/servers/gunicorn_config.py --forwarded-allow-ips "*" pr_agent.servers.github_app:app + diff --git a/pr_agent/servers/gunicorn_config.py b/pr_agent/servers/gunicorn_config.py index 1b4034bf..c4b0d335 100644 --- a/pr_agent/servers/gunicorn_config.py +++ b/pr_agent/servers/gunicorn_config.py @@ -24,7 +24,9 @@ import os # # bind = '0.0.0.0:5000' -bind = '0.0.0.0:3000' +# Use Heroku's PORT env var if available, otherwise default to 3000 +port = int(os.getenv('PORT', '3000')) +bind = f'0.0.0.0:{port}' backlog = 2048 # diff --git a/runtime.txt b/runtime.txt new file mode 100644 index 00000000..51a25b56 --- /dev/null +++ b/runtime.txt @@ -0,0 +1,2 @@ +python-3.12.10 +