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
Percy2y ago
Project ID: 84e706b8-15e7-4e91-b632-a29059b1c00a
Yuri Achermann
Yuri AchermannOP2y ago
84e706b8-15e7-4e91-b632-a29059b1c00a
Brody
Brody2y 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 AchermannOP2y ago
It does not pass the healthcheck...
Brody
Brody2y ago
show me your service variables please
Yuri Achermann
Yuri AchermannOP2y ago
What do you mean exactly?
Yuri Achermann
Yuri AchermannOP2y ago
I declared env variables but I'm actually not using
Brody
Brody2y ago
are you connecting to a database? or connecting to any external service upon app start
Yuri Achermann
Yuri AchermannOP2y ago
Yes, I'm connecting to an Azure Blob Storage...
Brody
Brody2y ago
how many times have you redoployed since opening this help thread?
Yuri Achermann
Yuri AchermannOP2y ago
You actually already helped me... mildpanic
Brody
Brody2y ago
what
Yuri Achermann
Yuri AchermannOP2y ago
I moved the connection to the inside of a function, and now it's working
Brody
Brody2y ago
yeah but do you see logs yet lol
Yuri Achermann
Yuri AchermannOP2y ago
At least I'm receiving deploy logs kekw
Brody
Brody2y ago
okay so all fixed?
Yuri Achermann
Yuri AchermannOP2y ago
I guess so, for that problem it is... probably will see another one ahead hahah Thanks a lot! You are awesome man
Brody
Brody2y ago
no problem! glad the problem is solved
Want results from more Discord servers?
Add your server