-
Hi, the error as mentioned in the title is thrown when running the container. Below I tried to describe my setup in detail. I have setup everything exactly as described in the readme. Therefore, this is how my Dockerfile looks like.
my directory structure is as follows.
then, in the When running the container, the following error is thrown. This is probably because How can I fix this? The problem has probably a very trivial solution, but I am currently stuck. Thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
I've just had a similar error. My source code directory is app.
OR
|
Beta Was this translation helpful? Give feedback.
-
@JaeHyunL nailed it! Thank you, whoever you are! I am using the Heroku container stack. My Dockerfile looked like this: FROM tiangolo/uvicorn-gunicorn-fastapi:python3.11-slim
COPY ./requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
COPY ./app /app I changed it to this (appended
Also, FWIW, my heroku.yml file looks like this: build:
docker:
web: Dockerfile
run:
web: sh /start.sh |
Beta Was this translation helpful? Give feedback.
-
Now that Uvicorn supports managing workers with Because of that, I deprecated this Docker image: https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker#-warning-you-probably-dont-need-this-docker-image That should also make it simpler to copy and setup the Docker image, making it easier to debug as well. 🤓 |
Beta Was this translation helpful? Give feedback.
Now that Uvicorn supports managing workers with
--workers
, including restarting dead ones, there's no need for Gunicorn. That also means that it's much simpler to build a Docker image from scratch now, I updated the docs to explain it.Because of that, I deprecated this Docker image: https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker#-warning-you-probably-dont-need-this-docker-image
That should also make it simpler to copy and setup the Docker image, making it easier to debug as well. 🤓