diff --git a/Dockerfile b/Dockerfile index 99f801234db47cfab3da618299973c61eaa41dc6..6379fb51404868e8c66902aaa88b0ff6d4b55479 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 6266caa4bbe9cc470e9d897cdcd8bad29718d5c7..0e3e20018353e36675953fa021bb56aef31a48c8 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,6 +1,6 @@ #!/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