-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrailway.toml
More file actions
62 lines (54 loc) · 1.8 KB
/
railway.toml
File metadata and controls
62 lines (54 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Railway Multi-Service Configuration
# This file ensures both web and worker services deploy automatically from GitHub
[build]
builder = "NIXPACKS"
[build.nixpacksPlan]
providers = ["python"]
[build.nixpacksPlan.phases.setup]
# Ensure Python, Node, and packaging tools are present in the image
nixPkgs = [
"python311",
"gcc",
"postgresql",
"redis",
"python311Packages.pip",
"python311Packages.setuptools",
"python311Packages.wheel",
"python311Packages.virtualenv",
"nodejs_20" # for building the React frontend
]
[build.nixpacksPlan.phases.install]
# Create a virtualenv and install into it; also install frontend deps
cmds = [
"python3 -V",
"which pip || true; pip --version || true",
"virtualenv --version",
"virtualenv -p python3 /opt/venv",
"/opt/venv/bin/python -V",
"/opt/venv/bin/pip --version",
"/opt/venv/bin/pip install --upgrade pip setuptools wheel",
"/opt/venv/bin/pip install -r requirements.txt",
"echo 'Python dependencies installed'",
"node --version && npm --version",
"npm --prefix frontend install"
]
[build.nixpacksPlan.phases.build]
dependsOn = ["install"]
cmds = [
"npm --prefix frontend run build"
]
# Test phase to run during build (optional)
[build.nixpacksPlan.phases.test]
dependsOn = ["build"]
cmds = [
"/opt/venv/bin/python scripts/run_tests_railway.py"
]
# Deploy configuration
[deploy]
restartPolicyType = "ON_FAILURE"
restartPolicyMaxRetries = 10
# Service-specific configurations will be handled by Railway service settings
# Each service should have its own start command configured in Railway dashboard:
# - Web service: the gunicorn command from railway.json or `python railway_start.py`
# - Worker service: python analysis_worker.py
# IMPORTANT: Worker service must have healthcheck DISABLED in Railway dashboard