From 8459aa3621916e706a767ad980c49baf9c2b4f81 Mon Sep 17 00:00:00 2001 From: nexy7574 Date: Sat, 20 Apr 2024 02:33:39 +0100 Subject: [PATCH] Enable specifying worker count at build time --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c325ed0..f1be79e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] \ No newline at end of file +ARG WORKERS=${WORKERS:-4} +CMD ["gunicorn", "-w", ${WORKERS}, "-b", "0.0.0.0:80", "--forwarded-allow-ips", "*", "--worker-class", "uvicorn.workers.UvicornWorker", "ipserv:app"] \ No newline at end of file