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

Error: Got unexpected extra argument (app.main:app)

vagarwal77 opened this issue · comments

vivekagarwal@-MacBook-Pro rwe_external_integrations % docker run -t exter-rwe:latest
Usage: uvicorn [OPTIONS] APP
Try 'uvicorn --help' for help.

Error: Got unexpected extra argument (app.main:app)

FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY ./app /app
EXPOSE 6565
ENTRYPOINT ["uvicorn"]
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "6565"]

Hey
seems like it's because of CMD definition. Don't know what exactly, but smth inside uvicorn can't start with args which uvicorn get from docker CMD
try:
CMD uvicorn app.main:app --host 0.0.0.0 --port 6565

Any update on this issue?

Hey seems like it's because of CMD definition. Don't know what exactly, but smth inside uvicorn can't start with args which uvicorn get from docker CMD try: CMD uvicorn app.main:app --host 0.0.0.0 --port 6565

This worked for me.

This should also work:

ENTRYPOINT ["uvicorn"]
CMD ["app.main:app", "--host", "0.0.0.0", "--port", "6565"]

(otherwise you will execute uvicorn uvicorn app.main:app ...)