-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FastApi, Uvicorn and Gunicorn are installed 2 times inside the docker image #280
Comments
You're right, the package is installed twice. However, removing the package from the dependencies does not work, as Poetry creates a virtual environment which don't has access to the system package. This seems to be an issue which is currently worked on: python-poetry/poetry#1393 Therefore removing the dependency from the pyproject.toml file would break the app. You can however use the gunicorn-uvicorn image if you want to, just make sure to keep your dependencies complete. The application should work the same I think? Regading the duplication of gunicorn and uvicorn, I don't think they are installed twice as uvicorn-gunicorn installs them and uvicorn-gunicorn-fastapi inherits from the container. |
Thank you that explains why poetry can't access system packages. |
Well, this Question has to be answered by @tiangolo 🤷♂️ |
You provide the fastapi docker image which installs fastapi via pip but fastapi ist still part of your poetry dependencies. This leads to an image that is 50MB larger and builds slower. First I tried to just remove fastapi from the poetry dependencies. However, the fastapi package could not be resolved this way. Feel free to let me know why, I used pipenv before and it worked out.
I went back to just using the plain gunicorn-uvicorn image.
Edit: I assume gunicorn and uvicorn are installed twice as well.
The text was updated successfully, but these errors were encountered: