Skip to content

Commit

Permalink
Set env in Dockerfile to make Gunicorn use Uvicorn workers
Browse files Browse the repository at this point in the history
This also reverts the previous commit fc45493.
Now uvicorn workers are used always when running with Docker
  • Loading branch information
juhoinkinen committed Apr 17, 2024
1 parent fc45493 commit ad464e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ RUN groupadd -g 998 annif_user && \
chown -R annif_user:annif_user /annif-projects /Annif/tests/data
USER annif_user

ENV GUNICORN_CMD_ARGS="--worker-class uvicorn.workers.UvicornWorker"

CMD annif
12 changes: 1 addition & 11 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,7 @@ services:
volumes:
- ${ANNIF_PROJECTS}:/annif-projects
user: ${MY_UID}:${MY_GID}
command:
[
"gunicorn",
"-k",
"uvicorn.workers.UvicornWorker",
"annif:create_app()",
"--bind",
"0.0.0.0:8000",
"--timeout",
"600"
]
command: ["gunicorn", "annif:create_app()", "--bind", "0.0.0.0:8000", "--timeout", "600"]

nginx:
image: nginx
Expand Down

0 comments on commit ad464e4

Please sign in to comment.