7 months ago
Problem to use Nixpacks
[stage-0 6/10] RUN gunicorn src.main:app --bind 0.0.0.0:$PORT --workers 4 --timeout 120
/bin/bash: line 1: gunicorn: command not found
✕ [stage-0 6/10] RUN gunicorn src.main:app --bind 0.0.0.0:$PORT --workers 4 --timeout 120
process "/bin/bash -ol pipefail -c gunicorn src.main:app --bind 0.0.0.0:$PORT --workers 4 --timeout 120" did not complete successfully: exit code: 127
Dockerfile:19
-------------------
17 | # start phase
18 | COPY . /app/.
19 | >>> RUN gunicorn src.main:app --bind 0.0.0.0:$PORT --workers 4 --timeout 120
20 |
21 | # install phase
-------------------
ERROR: failed to build: failed to solve: process "/bin/bash -ol pipefail -c gunicorn src.main:app --bind 0.0.0.0:$PORT --workers 4 --timeout 120" did not complete successfully: exit code: 127
Error: Docker build failed
1 Replies
7 months ago
/bin/bash: line 1: gunicorn: command not found looks like nixpacks cant find gunicorn.
I do not know nixpacks but according to googles overview:
a nixpacks.toml file in project root containing:
[phases.setup]
nixPkgs = ["python311", "python311Packages.gunicorn"]
cmds = ["pip install -r requirements.txt"]
[start]
cmd = "gunicorn src.main:app --bind 0.0.0.0:$PORT --workers 4 --timeout 120"
Might help. Unsure entirely about this though so do take with a grain of salt.