Hi! I am trying to implement a docker healthcheck with an Orthanc Python container, similarly to Orthan docker’s, but I couldn’t find the same for the Orthanc python version. I looked a bit through the github repos as well, but couldn’t find any info on that.
Would you have any tips? Or should I just use curl -f http://localhost:8042/changes
or similar?
Dockerfile:
FROM jodogne/orthanc-python:1.12.8
RUN apt-get update && \
apt-get install -y --no-install-recommends \
python3-venv \
python3-dev \
libpq-dev \
gcc
RUN python3 -m venv /.venv
WORKDIR /etc/orthanc
COPY requirements.txt ./
RUN /.venv/bin/pip install --no-cache-dir -r requirements.txt
ENV PYTHONPATH=/.venv/lib64/python3.11/site-packages/
and in my current docker-compose.yaml
:
orthanc_ntrc:
build:
context: ./orthanc
dockerfile: Dockerfile
...
healthcheck:
test: ["CMD", "curl", "-f", "-u", "user:userPassword", "http://localhost:8042/changes"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
This shows “(unhealthy)” in docker ps
.
Running that curl command outside the container in the terminal returns a json output, similar looking at it in a browser.
Thanks!