From dd3270675a6e992cc4e6411befa817854c1e73ac Mon Sep 17 00:00:00 2001 From: Eric0801 <33929918+Eric0801@users.noreply.github.com> Date: Sun, 19 Oct 2025 17:36:26 +0800 Subject: [PATCH] fix: reduce gunicorn workers to 2 for Railway memory limit --- Procfile | 2 +- railway.json | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 railway.json diff --git a/Procfile b/Procfile index 66c4d2e..291b377 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: gunicorn main:app --preload --workers 28 --timeout 120 \ No newline at end of file +web: gunicorn -w 2 -b 0.0.0.0:$PORT --timeout 120 main:app diff --git a/railway.json b/railway.json new file mode 100644 index 0000000..5944f09 --- /dev/null +++ b/railway.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://railway.app/railway.schema.json", + "build": { + "builder": "DOCKERFILE", + "dockerfilePath": "Dockerfile" + }, + "deploy": { + "startCommand": "cd /flask && gunicorn -w 2 -b 0.0.0.0:8000 --timeout 120 main:app", + "restartPolicyType": "ON_FAILURE", + "restartPolicyMaxRetries": 10 + } +}