From e62c80729559457c937b9740cb3bab960e6103d3 Mon Sep 17 00:00:00 2001 From: UncleCode Date: Sat, 16 Nov 2024 16:38:13 +0800 Subject: [PATCH] feat(deploy): add Railway deployment configuration and setup instructions --- deploy/railway/README.md | 19 +++++++++++++++++++ deploy/railway/button.json | 33 +++++++++++++++++++++++++++++++++ deploy/railway/railway.toml | 18 ++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 deploy/railway/README.md create mode 100644 deploy/railway/button.json create mode 100644 deploy/railway/railway.toml diff --git a/deploy/railway/README.md b/deploy/railway/README.md new file mode 100644 index 00000000..155e7642 --- /dev/null +++ b/deploy/railway/README.md @@ -0,0 +1,19 @@ +# Railway Deployment + +## Quick Deploy +[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/crawl4ai) + +## Manual Setup +1. Fork this repository +2. Create a new Railway project +3. Configure environment variables: + - `INSTALL_TYPE`: basic or all + - `ENABLE_GPU`: true/false +4. Deploy! + +## Configuration +See `railway.toml` for: +- Memory limits +- Health checks +- Restart policies +- Scaling options \ No newline at end of file diff --git a/deploy/railway/button.json b/deploy/railway/button.json new file mode 100644 index 00000000..1fc52167 --- /dev/null +++ b/deploy/railway/button.json @@ -0,0 +1,33 @@ +{ + "name": "Crawl4AI", + "description": "LLM Friendly Web Crawler & Scraper", + "render": { + "dockerfile": { + "path": "Dockerfile" + } + }, + "env": [ + { + "key": "INSTALL_TYPE", + "description": "Installation type (basic/all)", + "default": "basic", + "required": true + }, + { + "key": "ENABLE_GPU", + "description": "Enable GPU support", + "default": "false", + "required": false + } + ], + "services": [ + { + "name": "web", + "dockerfile": "./Dockerfile", + "healthcheck": { + "path": "/health", + "port": 11235 + } + } + ] + } \ No newline at end of file diff --git a/deploy/railway/railway.toml b/deploy/railway/railway.toml new file mode 100644 index 00000000..f24d8fab --- /dev/null +++ b/deploy/railway/railway.toml @@ -0,0 +1,18 @@ +# railway.toml +[build] +builder = "DOCKERFILE" +dockerfilePath = "Dockerfile" + +[deploy] +startCommand = "uvicorn main:app --host 0.0.0.0 --port $PORT" +healthcheckPath = "/health" +restartPolicyType = "ON_FAILURE" +restartPolicyMaxRetries = 3 + +[deploy.memory] +soft = 2048 # 2GB min for Playwright +hard = 4096 # 4GB max + +[deploy.scaling] +min = 1 +max = 1