-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnixpacks.toml
More file actions
64 lines (57 loc) · 1.82 KB
/
nixpacks.toml
File metadata and controls
64 lines (57 loc) · 1.82 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
63
64
# Nixpacks configuration for Railway deployment with integrated testing
# This configuration runs tests during the build phase
[phases.setup]
# Include Python, Node.js, and build tools
nixPkgs = [
"python311",
"nodejs_20",
"gcc",
"postgresql",
"redis",
"python311Packages.pip",
"python311Packages.setuptools",
"python311Packages.wheel",
"python311Packages.virtualenv"
]
[phases.install]
# Create and use a dedicated venv; install both Python and Node dependencies
cmds = [
"python3 -V",
"node --version",
"npm --version",
"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 successfully'",
"echo '📦 Installing frontend dependencies...'",
"cd frontend && rm -rf node_modules package-lock.json && npm install && cd ..",
"echo '📦 Frontend dependencies installed successfully'"
]
[phases.test]
dependsOn = ["install"]
cmds = [
# Run tests with the venv Python so dependencies resolve correctly
"/opt/venv/bin/python scripts/run_tests_railway.py"
]
[phases.build]
dependsOn = ["test"]
cmds = [
# Build frontend
"echo '🔨 Building frontend...'",
"cd frontend && npm run build && cd ..",
"echo '✅ Frontend built successfully!'",
# No model downloads needed - using Modal ML service
"echo '🚀 Using Modal ML service for sentiment analysis'",
"echo '✅ Build complete!'"
]
# Start command is defined in Procfile
[start]
# Explicitly use venv Python for runtime
cmd = "/opt/venv/bin/python railway_start.py"
[variables]
RAILWAY_RUN_TESTS = "true"
PYTEST_OPTIONS = "-v --tb=short"