R
Railway14mo ago
小白

Error: Docker build failed

I am using Railway to deploy my FastAPI service. I did not write a Dockerfile, but the mentioned error occurred. How should I resolve this? My local environment is Python 3.11, and I use Poetry for package management.
17 Replies
Percy
Percy14mo ago
Project ID: N/A
Brody
Brody14mo ago
do you have a .python-version or a runtime.txt file?
小白
小白14mo ago
No, I don't have these files
Brody
Brody14mo ago
change the python version in your pyproject.toml or pipfile to 3.11
小白
小白14mo ago
[tool.poetry.dependencies] python = "^3.11" fastapi = "^0.103.1" uvicorn = "^0.23.2" pytest = "^7.4.2" httpx = "^0.25.0" python-dotenv = "^1.0.0" line-bot-sdk = "^3.5.0" My version is already 3.11
Brody
Brody14mo ago
oh odd, try putting 3.11 into a .python-version file
小白
小白14mo ago
So I need to create a .python-version and put 3.11 in it?
Brody
Brody14mo ago
correct
小白
小白14mo ago
He still got the error, I have created .python-version and filled in 3.11
Brody
Brody14mo ago
that's progress through, it's a different error can you send your pyproject.toml ?
Brody
Brody14mo ago
try removing this line packages = [{include = "ppc_line_member_management_api"}]
小白
小白14mo ago
I also want to know if you want to set startup parameters, you must create railway.json, right? He's up and running now, thank you very much😁
Brody
Brody14mo ago
you can use a railway.json or a railway.toml, I would recommend the railway.json format since it has a schema, you can copy your current railway.json from the details tab within a deployment
小白
小白14mo ago
OK, thanks!
Brody
Brody14mo ago
no problem!
Want results from more Discord servers?
Add your server