perf: optimize the api image health check ()

### Description

Having curl installed in the API container improves operations and the
efficiency of the health check. Launching python to do a single http
call is an overkill.


Co-authored-by: Jonas L <jooola@users.noreply.github.com>
This commit is contained in:
Cristian Oneț 2024-06-22 14:18:50 +03:00 committed by GitHub
parent 4642b6c08e
commit d99d6e1a68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -141,6 +141,7 @@ FROM python-base as libretime-api
RUN set -eux \
&& DEBIAN_FRONTEND=noninteractive apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
curl \
gcc \
libc6-dev \
libpq-dev \
@ -174,8 +175,7 @@ CMD ["/usr/local/bin/gunicorn", \
ARG LIBRETIME_VERSION
ENV LIBRETIME_VERSION=$LIBRETIME_VERSION
HEALTHCHECK CMD ["python3", "-c", \
"import requests; requests.get('http://localhost:9001/api/v2/version').raise_for_status()"]
HEALTHCHECK CMD ["curl", "--fail", "http://localhost:9001/api/v2/version"]
#======================================================================================#
# Worker #