I don't see deploy logs even though it builds correctly

I'm deploying a FastAPI server using Dockerfile My railway.toml:
[build]
builder = "dockerfile"
dockerfilePath = "Dockerfile"

[deploy]
numReplicas = 1
startCommand = "uvicorn app:app --host 0.0.0.0 --port 8080"
healthcheckPath = "/healthcheck"
healthcheckTimeout = 300
restartPolicyType = "on_failure"
restartPolicyMaxRetries = 10
[build]
builder = "dockerfile"
dockerfilePath = "Dockerfile"

[deploy]
numReplicas = 1
startCommand = "uvicorn app:app --host 0.0.0.0 --port 8080"
healthcheckPath = "/healthcheck"
healthcheckTimeout = 300
restartPolicyType = "on_failure"
restartPolicyMaxRetries = 10
My Dockerfile:
FROM python:3.10-slim-buster
# Try python:3.8-slim-buster-gpu

LABEL Maintainer="yuriachermann"

WORKDIR /app

RUN apt-get update && apt-get install -y libgl1-mesa-glx libglib2.0-0 libsm6 libxext6 libxrender-dev pciutils lm-sensors libx11-doc libxcb-doc

COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt

COPY . .

EXPOSE 8080

CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080"]
FROM python:3.10-slim-buster
# Try python:3.8-slim-buster-gpu

LABEL Maintainer="yuriachermann"

WORKDIR /app

RUN apt-get update && apt-get install -y libgl1-mesa-glx libglib2.0-0 libsm6 libxext6 libxrender-dev pciutils lm-sensors libx11-doc libxcb-doc

COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt

COPY . .

EXPOSE 8080

CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080"]
And the execution call on app.py in root folder:
if __name__ == "__main__":
uvicorn.run(app, host="localhost", port=8080)
if __name__ == "__main__":
uvicorn.run(app, host="localhost", port=8080)
18 Replies
Percy
Percy13mo ago
Project ID: 84e706b8-15e7-4e91-b632-a29059b1c00a
Yuri Achermann
Yuri Achermann13mo ago
84e706b8-15e7-4e91-b632-a29059b1c00a
Brody
Brody13mo ago
first off, please remove the start command from the nixpacks.toml file, it is redundant (this won't solve the problem, it just annoys me lol)
Yuri Achermann
Yuri Achermann13mo ago
It does not pass the healthcheck...
Brody
Brody13mo ago
show me your service variables please
Yuri Achermann
Yuri Achermann13mo ago
What do you mean exactly?
Yuri Achermann
Yuri Achermann13mo ago
I declared env variables but I'm actually not using
Brody
Brody13mo ago
are you connecting to a database? or connecting to any external service upon app start
Yuri Achermann
Yuri Achermann13mo ago
Yes, I'm connecting to an Azure Blob Storage...
Brody
Brody13mo ago
how many times have you redoployed since opening this help thread?
Yuri Achermann
Yuri Achermann13mo ago
You actually already helped me... mildpanic
Brody
Brody13mo ago
what
Yuri Achermann
Yuri Achermann13mo ago
I moved the connection to the inside of a function, and now it's working
Brody
Brody13mo ago
yeah but do you see logs yet lol
Yuri Achermann
Yuri Achermann13mo ago
At least I'm receiving deploy logs kekw
Brody
Brody13mo ago
okay so all fixed?
Yuri Achermann
Yuri Achermann13mo ago
I guess so, for that problem it is... probably will see another one ahead hahah Thanks a lot! You are awesome man
Brody
Brody13mo ago
no problem! glad the problem is solved