diff --git a/Dockerfile b/Dockerfile index ebd3ee2..6b2f7d8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,21 +49,15 @@ RUN chown $USER_NAME $STORAGE_DIR ARG EXTRA_PACKAGES="wsgi_cors_middleware" RUN pip install ${EXTRA_PACKAGES} +USER $USER_NAME + WORKDIR /app ENV UWSGI_MODULE "giftless.wsgi_entrypoint" -ARG PORT=5000 -EXPOSE $PORT -# embed the default port into docker-entrypoint.sh, and make it executable -RUN set -eu ;\ - de=scripts/docker-entrypoint.sh ;\ - sed -i "/^default_port=/s/5000/$PORT/" "$de" ;\ - chmod +x "$de" - -USER $USER_NAME - -ENTRYPOINT ["tini", "--", "scripts/docker-entrypoint.sh"] +ENTRYPOINT ["tini", "uwsgi", "--"] +CMD ["-s", "127.0.0.1:5000", "-M", "-T", "--threads", "2", "-p", "2", \ + "--manage-script-name", "--callable", "app"] # TODO remove this STOPSIGNAL override after uwsgi>=2.1 STOPSIGNAL SIGQUIT diff --git a/scripts/docker-entrypoint.sh b/scripts/docker-entrypoint.sh deleted file mode 100644 index 793cd09..0000000 --- a/scripts/docker-entrypoint.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -default_port=5000 -if [ $# -eq 0 ]; then - # listen on localhost:PORT by default - exec uwsgi -s "127.0.0.1:$default_port" -M -T --threads 2 -p 2 --manage-script-name --callable app -else - # use custom arguments - exec uwsgi "$@" -fi \ No newline at end of file