-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to gunicorn instead of uwsgi
- Loading branch information
Showing
3 changed files
with
25 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
FROM rgaudin/uwsgi-nginx:python3.8 | ||
FROM python:3.8-slim-bookworm | ||
LABEL zimfarm=true | ||
LABEL org.opencontainers.image.source https://github.com/openzim/zimfarm | ||
|
||
RUN pip install --no-cache-dir -U pip | ||
RUN pip install --no-cache-dir uwsgi==2.0.18 | ||
RUN pip install --no-cache-dir -U pip gunicorn==21.2.0 | ||
|
||
COPY requirements.txt /app/ | ||
RUN pip install --no-cache-dir -r /app/requirements.txt | ||
|
@@ -16,16 +15,6 @@ WORKDIR /app/ | |
ENV DOCS_DIR /app/docs | ||
ENV INIT_PASSWORD admin | ||
|
||
# from uwsgi-nginx | ||
ENV UWSGI_INI /app/uwsgi.ini | ||
ENV UWSGI_CHEAPER 4 | ||
ENV UWSGI_CHEAPER_STEP 2 | ||
ENV UWSGI_PROCESSES 32 | ||
ENV NGINX_MAX_UPLOAD 0 | ||
ENV NGINX_WORKER_PROCESSES 1 | ||
ENV LISTEN_PORT 80 | ||
ENV NGINV_ENABLE_GZIP 1 | ||
|
||
# mailgun for notifications | ||
ENV MAILGUN_API_URL https://api.mailgun.net/v3/mg.farm.openzim.org | ||
ENV MAILGUN_FROM Zimfarm <[email protected]> | ||
|
@@ -52,3 +41,5 @@ RUN chmod +x /app/prestart.sh | |
COPY supervisor-listener.py /usr/local/bin/supervisor-listener | ||
RUN chmod +x /usr/local/bin/supervisor-listener | ||
COPY periodic.conf /etc/supervisor/conf.d/periodic.conf | ||
|
||
CMD ["gunicorn", "--conf", "/app/gunicorn_conf.py", "--bind", "0.0.0.0:8000", "main:application"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Gunicorn config variables | ||
loglevel = "info" | ||
errorlog = "-" # stderr | ||
accesslog = "-" # stdout | ||
worker_tmp_dir = "/dev/shm" | ||
graceful_timeout = 60 | ||
timeout = 60 | ||
keepalive = 5 | ||
threads = 3 |