Skip to content

Commit

Permalink
reduces the amount of uvicorn workers to 2
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielBarberini committed Jan 28, 2024
1 parent 7ac18eb commit 3f387c2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ FROM python:3.11-slim-bookworm

EXPOSE 3000

WORKDIR /code
WORKDIR /app

COPY ./requirements.txt /code/requirements.txt
COPY ./requirements.txt /app/requirements.txt

RUN apt-get update && \
apt-get install -y --no-install-recommends git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
pip3 install --no-cache-dir --upgrade -r /code/requirements.txt && \
pip3 install --no-cache-dir --upgrade -r /app/requirements.txt && \
apt-get purge -y --auto-remove && \
rm -rf /var/lib/apt/lists/*

COPY ./lib /code/lib
COPY ./lib /app/lib

CMD ["gunicorn", "-w 4", "-k", "uvicorn.workers.UvicornWorker", "lib:app", "--log-level", "Debug", "-b", "0.0.0.0:3000", "--timeout", "120"]
CMD ["gunicorn", "-w 2", "-k", "uvicorn.workers.UvicornWorker", "lib:app", "--log-level", "Debug", "-b", "0.0.0.0:3000", "--timeout", "120"]

0 comments on commit 3f387c2

Please sign in to comment.