Skip to content

Commit

Permalink
feat(docker): add script to echo deprecation warning conditionally e.…
Browse files Browse the repository at this point in the history
…g. for Dockerhub images
  • Loading branch information
demenech committed Dec 26, 2024
1 parent 99debd3 commit 3caa9f9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ WORKDIR /app

ENV UWSGI_MODULE "giftless.wsgi_entrypoint"

ENTRYPOINT ["tini", "uwsgi", "--"]
CMD ["-s", "127.0.0.1:5000", "-M", "-T", "--threads", "2", "-p", "2", \
ARG IS_DOCKERHUB
ENV IS_DOCKERHUB=$IS_DOCKERHUB

ENTRYPOINT ["scripts/docker-prerun.sh"]
CMD ["tini", "uwsgi", "--", "-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
Expand Down
16 changes: 16 additions & 0 deletions scripts/docker-prerun.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/sh

# ANSI color codes
RED='\033[1;31m'
YELLOW='\033[1;33m'
RESET='\033[0m'

if [ "$IS_DOCKERHUB" = true ]; then
echo "${RED}**********************************************${RESET}"
echo "${YELLOW}WARNING:${RESET} This Docker image from docker.io is deprecated!"
echo "${YELLOW}It will no longer be maintained. Please use ghcr.io/datopian/giftless."
echo "${YELLOW}Refer to https://github.com/datopian/giftless for more details."
echo "${RED}**********************************************${RESET}"
fi

exec "$@"

0 comments on commit 3caa9f9

Please sign in to comment.