Skip to content

Commit 642c478

Browse files
committed
fix(deploy): set buildContext for Railway backend deployment
Problem: Railway deployment failing with error: 'failed to compute cache key: "/requirements.txt": not found' Root Cause: Railway was building from root directory but Dockerfile references files in backend/ directory (requirements.txt, services/, etc.) Solution: Add buildContext field to railway.json to specify backend/ as the build directory. Changes: - Add "buildContext": "backend" to railway.json build configuration - Railway now correctly builds from backend/ directory - All COPY commands in Dockerfile now resolve correctly Result: Railway deployment builds successfully
1 parent 161468e commit 642c478

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

railway.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"$schema": "https://railway.app/railway.schema.json",
33
"build": {
44
"builder": "DOCKERFILE",
5-
"dockerfilePath": "backend/Dockerfile"
5+
"dockerfilePath": "backend/Dockerfile",
6+
"buildContext": "backend"
67
},
78
"deploy": {
89
"startCommand": "uvicorn main:app --host 0.0.0.0 --port $PORT",

0 commit comments

Comments
 (0)