From f88bf075cef58f8fb4b109564401ad257c67d31c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20L=C3=B3pez?= Date: Sun, 23 Sep 2018 03:29:03 -0500 Subject: [PATCH] add wsgi servers --- Dockerfile | 4 ++++ README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/Dockerfile b/Dockerfile index f643b68..f229468 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,7 @@ RUN apk -U upgrade \ libffi-dev \ py2-pip \ build-base \ + linux-headers \ && apk add \ python \ py-setuptools \ @@ -21,9 +22,12 @@ RUN apk -U upgrade \ && pip install --no-cache cffi \ && pip install --no-cache misaka==1.0.2 \ && pip install --no-cache "isso==${ISSO_VER}" \ + && pip install --no-cache gevent uwsgi gunicorn #wsgi servers \ && apk del build-dependencies \ + && mkdir -p /var/spool/isso \ && rm -rf /tmp/* /var/cache/apk/* + COPY run.sh /usr/local/bin/run.sh RUN chmod +x /usr/local/bin/run.sh diff --git a/README.md b/README.md index 6ed7bd9..25a58b1 100644 --- a/README.md +++ b/README.md @@ -45,3 +45,46 @@ isso: - /mnt/docker/isso/config:/config - /mnt/docker/isso/db:/db ``` + +#### Example of uWSGI configuration +``` +# /mnt/docker/isso/config/isso.uwsgi +[uwsgi] +http = :8080 +master = true +; set to `nproc` +processes = 4 +cache2 = name=hash,items=1024,blocksize=32 +; you may change this +spooler = /var/spool/isso +module = isso.run + +# docker-compose.yml +isso: + image: wonderfall/isso + environment: + - GID=1000 + - UID=1000 + command: uwsgi --ini /config/isso.uwsgi + volumes: + - /mnt/docker/isso/config:/config + - /mnt/docker/isso/db:/db + environment: + - ISSO_SETTINGS=/config/isso.conf +``` + +#### Example of Gunicorn configuration +``` +# docker-compose.yml +isso: + image: wonderfall/isso + environment: + - GID=1000 + - UID=1000 + command: gunicorn -b :8080 -w 4 --preload isso.run + volumes: + - /mnt/docker/isso/config:/config + - /mnt/docker/isso/db:/db + environment: + - ISSO_SETTINGS=/config/isso.conf +```