Skip to content

Commit

Permalink
chore(dockerfile): fix default port to 5000
Browse files Browse the repository at this point in the history
Making it configurable via a build arg complicates the whole dockerfile setup way too much for such a useless feature :)
  • Loading branch information
vit-zikmund committed Mar 28, 2024
1 parent c65a00b commit bc5ef89
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
16 changes: 5 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 0 additions & 9 deletions scripts/docker-entrypoint.sh

This file was deleted.

0 comments on commit bc5ef89

Please sign in to comment.