Enable specifying worker count at build time
This commit is contained in:
parent
de91ba67dc
commit
8459aa3621
1 changed files with 3 additions and 2 deletions
|
@ -2,6 +2,7 @@ FROM python:3-slim
|
|||
|
||||
WORKDIR /app
|
||||
COPY ipserv.py /app
|
||||
EXPOSE 80
|
||||
EXPOSE 80/tcp
|
||||
RUN pip install fastapi requests gunicorn uvicorn[standard] aiohttp
|
||||
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:80", "--forwarded-allow-ips", "*", "--worker-class", "uvicorn.workers.UvicornWorker", "ipserv:app"]
|
||||
ARG WORKERS=${WORKERS:-4}
|
||||
CMD ["gunicorn", "-w", ${WORKERS}, "-b", "0.0.0.0:80", "--forwarded-allow-ips", "*", "--worker-class", "uvicorn.workers.UvicornWorker", "ipserv:app"]
|
Reference in a new issue