tiangolo / uvicorn-gunicorn-fastapi-docker

Docker image with Uvicorn managed by Gunicorn for high-performance FastAPI web applications in Python with performance auto-tuning.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: Why does python3.8-slim image not come with fastapi pre-installed?

naveen-marthala opened this issue · comments

I have pulled and ran the image. And then opened terminal inside the container and when I ran 'pip3 freeze', this is the output:

click==7.1.1
gunicorn==20.0.4
h11==0.9.0
httptools==0.1.1
uvicorn==0.11.3
uvloop==0.14.0
websockets==8.1

So, I would like to know why fastAPI is not installed by default, when all the helper server packages are and it being in the name of this repo?

I think no one may have responded because your question is not clear.

Are you really asking why python3.8-slim does not have FastAPI on it? FastAPI is a specific web framework. While it is a great framework, I would suspect that (a) 99.9% of Python projects do not use it, and (b) it is quite large. It is not something that the 99.9% of other projects would want bulking up their work.

Or, do you mean to ask, "why is there no 'slim' version of fastapi"? My guess is that no one has had the time or energy to create it. I suspect if you put together a good Dockerfile to do this, it would be accepted into the project.

Just like 99.9% of python projects don't use FastAPI, so are uvicorn and gunicorn, which are installed in the image. So, my question was to ask about the absence of FastAPI, when it's dependencies are installed in the image.

EDIT: Or should I be asking about the presence of uvicorn and gunicorn, when 99.9% of projects don't actually use them.

I assume you solved it, thanks for closing the issue 👍

Anyway, I checked, and FastAPI seems to be included as expected 🤷

$ docker run --rm -it tiangolo/uvicorn-gunicorn-fastapi:python3.8-slim pip3 freeze
Unable to find image 'tiangolo/uvicorn-gunicorn-fastapi:python3.8-slim' locally
python3.8-slim: Pulling from tiangolo/uvicorn-gunicorn-fastapi
54fec2fa59d0: Pull complete
cd3f35d84cab: Pull complete
a0afc8e92ef0: Pull complete
9691f23efdb7: Pull complete
9fd98872783d: Pull complete
87f9e3d4e596: Pull complete
a815d3c0e7f7: Pull complete
4c9600199185: Pull complete
ad63dfa2975a: Pull complete
a0df076a6f63: Pull complete
53e0503c66c0: Pull complete
5107cbf6f48a: Pull complete
287285a75ba3: Pull complete
5aae5624408d: Pull complete
Digest: sha256:edb2e3ecbb922c199ce23ca8b4dc60bdf65a7829bc2b6bd3767392566f437e04
Status: Downloaded newer image for tiangolo/uvicorn-gunicorn-fastapi:python3.8-slim
click==7.1.1
fastapi==0.62.0
gunicorn==20.0.4
h11==0.9.0
httptools==0.1.1
pydantic==1.7.3
starlette==0.13.6
uvicorn==0.11.3
uvloop==0.14.0
websockets==8.1