Skip to content
Snippets Groups Projects
Commit d807a1b7 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Merge branch 'feature/use-wsgi-in-docker' into 'master'

Use uWSGI in Docker

See merge request !515
parents 1c949fe3 397943ef
No related branches found
No related tags found
1 merge request!515Use uWSGI in Docker
Pipeline #6274 canceled
......@@ -13,6 +13,7 @@ ENV PIP_USE_DEPRECATED legacy-resolver
ENV ALEKSIS_static__root /usr/share/aleksis/static
ENV ALEKSIS_media__root /var/lib/aleksis/media
ENV ALEKSIS_backup__location /var/lib/aleksis/backups
ENV ALEKSIS_dev__uwsgi__celery false
# Install necessary Debian and PyPI packages for build and runtime
RUN apt-get -y update && \
......@@ -26,7 +27,7 @@ RUN apt-get -y update && \
libssl-dev \
netcat-openbsd \
yarnpkg && \
eatmydata pip install gunicorn django-compressor
eatmydata pip install uwsgi django-compressor
# Install extra dependencies
ARG EXTRAS="ldap"
......@@ -48,7 +49,7 @@ RUN set -e; \
# Declare a persistent volume for all data
VOLUME /var/lib/aleksis
# Define entrypoint and gunicorn running on port 8000
# Define entrypoint and uWSGI running on port 8000
EXPOSE 8000
COPY docker-entrypoint.sh /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
......
#!/bin/bash
GUNICORN_BIND=${GUNICORN_BIND:-0.0.0.0:8000}
HTTP_PORT=${HTTP_PORT:8000}
export ALEKSIS_database__host=${ALEKSIS_database__host:-127.0.0.1}
export ALEKSIS_database__port=${ALEKSIS_database__port:-5432}
......@@ -22,12 +22,12 @@ aleksis-admin collectstatic --no-input --clear
aleksis-admin migrate
aleksis-admin createinitialrevisions
ARG=${$1:-"gunicorn"}
ARG=${1:-uwsgi}
if [ $ARG = "celery_worker" ]; then
exec celery -A aleksis.core worker -l info
elif [ $ARG = "celery_beat" ]; then
exec celery -A aleksis.core beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler
else
exec gunicorn aleksis.core.wsgi --bind ${GUNICORN_BIND}
exec aleksis-admin runuwsgi http=$HTTP_PORT
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment