Skip to content

Commit

Permalink
Merge pull request #425 from PnX-SI/feat/docker
Browse files Browse the repository at this point in the history
Feat/docker
  • Loading branch information
camillemonchicourt committed Aug 8, 2023
2 parents 7929f8e + f6513a7 commit 182f314
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 .
Expand Down Expand Up @@ -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"]
7 changes: 7 additions & 0 deletions docker_healthcheck.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
# docker healthcheck TH
url_test=http://localhost:5000${TAXHUB_APPLICATION_ROOT}/
if [ ! -f /tmp/container_healthy ]; then
curl -f "${url_test}" || exit 1
touch /tmp/container_healthy
fi

0 comments on commit 182f314

Please sign in to comment.