Skip to content

Commit

Permalink
Use fastapi run in Docker and single worker
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Sep 8, 2024
1 parent fba859b commit 2df8afa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.github
.ruff_cache
.vscode
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ WORKDIR /opt
COPY . lvmapi

RUN pip3 install -U pip setuptools wheel
RUN cd lvmapi && pip3 install .
RUN rm -Rf lvmapi
RUN cd lvmapi && pip3 install -U -e .

ENTRYPOINT gunicorn lvmapi.app:app --workers 4 --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:80
CMD ["fastapi", "run", "lvmapi/src/lvmapi/app.py", "--port", "80", "--workers", "1"]

0 comments on commit 2df8afa

Please sign in to comment.