Skip to content

Commit

Permalink
Merge pull request #4144 from telefonicaid/task/add_healthcheck_docker
Browse files Browse the repository at this point in the history
add docker healthcheck based on API /version
  • Loading branch information
fgalan authored May 26, 2022
2 parents b9d7e3d + 9e78dd1 commit 5cd0c56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- Add: Docker healthcheck based on context broker API
- Add: support for Feature and FeaturesCollection GeoJSON types (normalizing geometries) in entity locations (#4114)
- Add: support to null element in string list filters (e.g. q=A:foo,null) (#4120)
- Add: improve BadInput logs with extra information when available (#4121)
Expand Down
6 changes: 5 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ RUN \
/opt/fiware-orion && \
# remove the same packages we installed at the beginning to build Orion
apt-get -y remove --purge \
curl \
cmake \
libssl-dev \
git \
Expand Down Expand Up @@ -170,3 +169,8 @@ LABEL "org.opencontainers.image.source"=https://github.com/${GITHUB_ACCOUNT}/${G
RUN sed -i -r "/^(root|nobody)/!d" /etc/passwd /etc/shadow /etc/group \
&& sed -i -r 's#^(.*):[^:]*$#\1:/sbin/nologin#' /etc/passwd
USER nobody

HEALTHCHECK --interval=60s --timeout=5s --start-period=10s \
# Note we cannot use GET /version for healthchecking as that operation is working even in the case
# the database is down. In this sense, GET /v2/entities is better, as it touches database
CMD curl --fail -X GET http://localhost:1026/v2/entities?limit=1 || exit 1

0 comments on commit 5cd0c56

Please sign in to comment.