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