From e8d42acdf09ffc18fe43693270b0a987dbb83913 Mon Sep 17 00:00:00 2001 From: Lincoln Ho <15695012+lincolnh0@users.noreply.github.com> Date: Fri, 27 Oct 2023 22:23:45 +0100 Subject: [PATCH] Add railway json configuration --- {{cookiecutter.project_slug}}/railway.json | 15 +++++++++++++++ {{cookiecutter.project_slug}}/requirements.txt | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 {{cookiecutter.project_slug}}/railway.json diff --git a/{{cookiecutter.project_slug}}/railway.json b/{{cookiecutter.project_slug}}/railway.json new file mode 100644 index 000000000..e629e816f --- /dev/null +++ b/{{cookiecutter.project_slug}}/railway.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://railway.app/railway.schema.json", + "build": { + "builder": "NIXPACKS" + }, + "deploy": { + {%- if cookiecutter.use_async == 'y' %} + "startCommand": "python manage.py migrate && python manage.py collectstatic --noinput && gunicorn config.asgi -k uvicorn.workers.UvicornWorker", + {%- else %} + "startCommand": "python manage.py migrate && python manage.py collectstatic --noinput && gunicorn config.wsgi", + {%- endif %} + "restartPolicyType": "ON_FAILURE", + "restartPolicyMaxRetries": 10 + } +} \ No newline at end of file diff --git a/{{cookiecutter.project_slug}}/requirements.txt b/{{cookiecutter.project_slug}}/requirements.txt index c1b500c2b..a4ca850ac 100644 --- a/{{cookiecutter.project_slug}}/requirements.txt +++ b/{{cookiecutter.project_slug}}/requirements.txt @@ -1,3 +1,3 @@ -# This file is expected by Heroku. +# This file is expected by Heroku/Railway. -r requirements/production.txt