File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11[phases .setup ]
2- nixPkgs = [" python312Full" ]
2+ nixPkgs = [" python312Full" ] # Includes Python 3.12 + pip
33
4- # Use the default Python install behavior but ensure we use the right requirements file
54[phases .install ]
65cmds = [
6+ # Upgrade pip and install dependencies from backend/requirements.txt
77 " /opt/venv/bin/python -m pip install --upgrade pip" ,
88 " /opt/venv/bin/python -m pip install -r backend/requirements.txt"
99]
1010
11-
1211[phases .build ]
1312cmds = [
14- " echo 'Build phase: Copying backend files'" ,
15- " cp -r backend/* . || echo 'Backend files already in place' "
13+ " echo 'Copying backend files to root '" ,
14+ " cp -r backend/* ."
1615]
1716
1817[start ]
19- # Run directly from the root directory since we copied the files there
2018cmd = " /opt/venv/bin/uvicorn main:app --host 0.0.0.0 --port $PORT"
2119
2220[variables ]
2321PYTHONPATH = " /app"
2422PYTHONUNBUFFERED = " 1"
2523
26- # Let Nixpacks handle virtual environment creation automatically
2724[nixpacks ]
Original file line number Diff line number Diff line change 22builder = " NIXPACKS"
33
44[deploy ]
5- # Updated start command to run directly without cd to backend
6- startCommand = " uvicorn main:app --host 0.0.0.0 --port $PORT"
5+ startCommand = " /opt/venv/bin/uvicorn main:app --host 0.0.0.0 --port $PORT"
76restartPolicyType = " ON_FAILURE"
87restartPolicyMaxRetries = 10
98
You can’t perform that action at this time.
0 commit comments