9 months ago
When building the new project, it shows unable to find Dockerfile.
the build log shows : Dockerfile Dockerfile does not exist
From the setting, I've set the root directory to be_poker
However, I'm able to see it from my git repo https://github.com/hyestt/poker_tracker/tree/main/be_poker Can anyone help ? Ty !
Pinned Solution
9 months ago
Hi. You don't need a railway.json configuration at all. Just delete the file. If it's not your repository, fork it and delete it.
There are tons of random AI responses in this thread which are really not helpful at all.
If you want to keep your configuration file, you can either delete the entire build part because it's automatic, or change it to the following.
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "DOCKERFILE",
"dockerfilePath": "be_poker/Dockerfile"
},
"deploy": {
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
} I recommend just deleting the file. It's redundant.
7 Replies
9 months ago
ChatGPT told us your dockerfile is not valid for Railway.
FROM python:3.11-slim AS build
WORKDIR /app
COPY pyproject.toml poetry.lock ./
RUN pip install poetry && poetry config virtualenvs.create false && poetry install --no-dev
COPY . .
FROM python:3.11-slim AS runtime
WORKDIR /app
COPY --from=build /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
COPY --from=build /app /app
ENV PYTHONUNBUFFERED=1
ARG PORT
ENV PORT=${PORT:-8000}
EXPOSE $PORT
CMD ["gunicorn", "be_poker.app:app", "--bind", "0.0.0.0:${PORT}"]
9 months ago
By default, railway look for a file named Dockerfile in the root directory. If your Dockerfile is in another directory, specify it like this:
RAILWAY_DOCKERFILE_PATH=/build/Dockerfilepaiji
By default, railway look for a file named Dockerfile in the root directory. If your Dockerfile is in another directory, specify it like this:RAILWAY_DOCKERFILE_PATH=/build/Dockerfile
9 months ago
it's in the root directory I specified (be_poker) and I can confirm the Dockerfile existed in that folder
hyestt
it's in the root directory I specified (be_poker) and I can confirm the Dockerfile existed in that folder
9 months ago
I'm not sure if the root directory setting is also effective for Dockerfile detection, maybe you can clear the root directory setting and manual set Dockerfile path?
hyestt
it's in the root directory I specified (be_poker) and I can confirm the Dockerfile existed in that folder
9 months ago
Hi. You don't need a railway.json configuration at all. Just delete the file. If it's not your repository, fork it and delete it.
There are tons of random AI responses in this thread which are really not helpful at all.
If you want to keep your configuration file, you can either delete the entire build part because it's automatic, or change it to the following.
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "DOCKERFILE",
"dockerfilePath": "be_poker/Dockerfile"
},
"deploy": {
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
} I recommend just deleting the file. It's redundant.
samgordon
Hi. You don't need a railway.json configuration at all. Just delete the file. If it's not your repository, fork it and delete it.There are tons of random AI responses in this thread which are really not helpful at all.If you want to keep your configuration file, you can either delete the entire build part because it's automatic, or change it to the following.{ "$schema": "https://railway.app/railway.schema.json", "build": { "builder": "DOCKERFILE", "dockerfilePath": "be_poker/Dockerfile" }, "deploy": { "restartPolicyType": "ON_FAILURE", "restartPolicyMaxRetries": 10 } }I recommend just deleting the file. It's redundant.
9 months ago
deployment works now ! Thanks bro.
Status changed to Solved uxuz • 9 months ago
