perf: optimize the api image health check (#3038)
### 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:
parent
4642b6c08e
commit
d99d6e1a68
|
@ -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 #
|
||||
|
|
Loading…
Reference in New Issue