From 053dbc921fd4b2c9e2b03ac92cc0eeafc6aa3f25 Mon Sep 17 00:00:00 2001 From: "joel.clement" Date: Mon, 3 Jul 2023 14:27:31 +0200 Subject: [PATCH 1/2] docker healthcheck && relaod on config.py --- Dockerfile | 5 ++++- docker_healthcheck.sh | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 docker_healthcheck.sh diff --git a/Dockerfile b/Dockerfile index c3a24986..2cca62c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,6 +30,7 @@ RUN python setup.py bdist_wheel FROM build AS build-taxhub WORKDIR /build/ COPY /setup.py . +COPY --chmod=755 /docker_healthcheck.sh . COPY /requirements-common.in . COPY /requirements-dependencies.in . COPY /VERSION . @@ -91,6 +92,8 @@ ENV PYTHONPATH=/dist/config/ ENV TAXHUB_SETTINGS=config.py ENV TAXHUB_STATIC_FOLDER=/dist/static +COPY --chmod=755 /docker_healthcheck.sh . + EXPOSE 5000 -CMD ["gunicorn", "apptax.app:create_app()", "--bind=0.0.0.0:5000", "--access-logfile=-", "--error-logfile=-"] +CMD ["gunicorn", "apptax.app:create_app()", "--bind=0.0.0.0:5000", "--access-logfile=-", "--error-logfile=-", "--reload", "--reload-extra-file=config/config.py"] diff --git a/docker_healthcheck.sh b/docker_healthcheck.sh new file mode 100644 index 00000000..27b99ea7 --- /dev/null +++ b/docker_healthcheck.sh @@ -0,0 +1,7 @@ +#!/bin/bash +# docker healthcheck TH +url_test=http://localhost:5000/taxhub/ +if [ ! -f /tmp/container_healthy ]; then + curl -f "${url_test}" || exit 1 + touch /tmp/container_healthy +fi \ No newline at end of file From f6513a74d279c7e1d9c7728f895f73d05e6fe7df Mon Sep 17 00:00:00 2001 From: "joel.clement" Date: Thu, 13 Jul 2023 12:40:25 +0200 Subject: [PATCH 2/2] up healthcheck --- docker_healthcheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker_healthcheck.sh b/docker_healthcheck.sh index 27b99ea7..aece6e98 100644 --- a/docker_healthcheck.sh +++ b/docker_healthcheck.sh @@ -1,6 +1,6 @@ #!/bin/bash # docker healthcheck TH -url_test=http://localhost:5000/taxhub/ +url_test=http://localhost:5000${TAXHUB_APPLICATION_ROOT}/ if [ ! -f /tmp/container_healthy ]; then curl -f "${url_test}" || exit 1 touch /tmp/container_healthy