Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/docker #425

Merged
merged 2 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading