a year ago
Despite a well constructed nixpacks.toml I cant seem to get this deployment to start, with a no start command could be found error. Here is the file:
[phases.setup]
pkgs = ["python3", "gcc"]
commands = ["pip install -r requirements.txt"]
[phases.install]
commands = [
"python -m venv --copies /opt/venv && . /opt/venv/bin/activate",
"pip install -r requirements.txt"
]
[phases.build]
commands = [
"python manage.py collectstatic --noinput",
"python manage.py migrate"
]
[phases.start]
commands = ["gunicorn --bind 0.0.0.0:$PORT myapp.asgi:application"]
ⓘ Deployment information is only viewable by project members and Railway employees.
6 Replies
a year ago
Unfortunately this would not be well constructed, you are redefining defaults, running pip install twice, and not using the correct syntax, it's just `start` not `phases.start`
a year ago
Brody thx for the response. I removed phases and with just [start] I get the same error.
Could you tell me please what else is necessary to deploy?
a year ago
[phases.setup]
pkgs = ["python3", "gcc"]
commands = ["pip install -r requirements.txt"]
[phases.install]
commands = [
"python -m venv --copies /opt/venv && . /opt/venv/bin/activate"
]
[phases.build]
commands = [
"python manage.py collectstatic --noinput",
"python manage.py migrate"
]
[start]
commands = ["gunicorn --bind 0.0.0.0:$PORT hashfire_api.asgi:application"]
a year ago
This would still be the incorrect syntax.
Let's try something different, delete the nixpacks.toml file, and replace it with this railway.json file -
{
"$schema": "https://railway.app/railway.schema.json",
"deploy": {
"startCommand": "python manage.py migrate && python manage.py collectstatic --noinput && gunicorn hashfire_api.asgi:application"
}
}
If you have any build or start commands set in the service settings, please remove them.
a year ago
Thanks again Brody. Thanks again for the help. This almost worked, but I'm getting a docker file/env dependency issue even though I'm not running docker.42.62 × Getting requirements to build wheel did not run successfully.
Jun 04 15:42:12
42.62 │ exit code: 1
Jun 04 15:42:12
42.62 ╰─> See above for output.
Jun 04 15:42:12
42.62
Jun 04 15:42:12
Jun 04 15:42:12
42.62 note: This error originates from a subprocess, and is likely not a problem with pip.
Jun 04 15:42:12
-----
Jun 04 15:42:12
Jun 04 15:42:12
Dockerfile:20
Jun 04 15:42:12
-------------------
Jun 04 15:42:12
18 | ENV NIXPACKS_PATH /opt/venv/bin:$NIXPACKS_PATH
Jun 04 15:42:12
19 | COPY . /app/.
Jun 04 15:42:12
20 | >>> RUN --mount=type=cache,id=s/4bfbe346-05f9-45ca-a24a-07e930d50807-/root/cache/pip,target=/root/.cache/pip python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt
Jun 04 15:42:12
21 |
Jun 04 15:42:12
22 |
Jun 04 15:42:12
-------------------
Jun 04 15:42:12
ERROR: failed to solve: process "/bin/bash -ol pipefail -c python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install -r requirements.txt" did not complete successfully: exit code: 1
Jun 04 15:42:12
Jun 04 15:42:12
Error: Docker build failed