R
Railway15mo 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
Percy15mo ago
Project ID: N/A
Brody
Brody15mo ago
do you have a .python-version or a runtime.txt file?
小白
小白OP15mo ago
No, I don't have these files
Brody
Brody15mo ago
change the python version in your pyproject.toml or pipfile to 3.11
小白
小白OP15mo 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
Brody15mo ago
oh odd, try putting 3.11 into a .python-version file
小白
小白OP15mo ago
So I need to create a .python-version and put 3.11 in it?
Brody
Brody15mo ago
correct
小白
小白OP15mo ago
He still got the error, I have created .python-version and filled in 3.11
Brody
Brody15mo ago
that's progress through, it's a different error can you send your pyproject.toml ?
Brody
Brody15mo ago
try removing this line packages = [{include = "ppc_line_member_management_api"}]
小白
小白OP15mo 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
Brody15mo 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
小白
小白OP15mo ago
OK, thanks!
Brody
Brody15mo ago
no problem!
Want results from more Discord servers?
Add your server