From 188a92d124bfc4e9a1318bc9e5e67dc920730a09 Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Wed, 12 Oct 2022 15:16:32 +0200 Subject: [PATCH] docker: add healthcheck --- .github/workflows/Dockerfile.ci.alpine | 7 ++++--- .github/workflows/Dockerfile.ci.debian | 9 +++++---- Dockerfile | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/Dockerfile.ci.alpine b/.github/workflows/Dockerfile.ci.alpine index 16022d9..e5d21c4 100644 --- a/.github/workflows/Dockerfile.ci.alpine +++ b/.github/workflows/Dockerfile.ci.alpine @@ -17,7 +17,7 @@ RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \ ls -la target/ . && \ pwd \ ; fi - + RUN if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \ mv bin/aarch64-bin/lldap target/lldap && \ mv bin/aarch64-bin/migration-tool target/migration-tool && \ @@ -26,7 +26,7 @@ RUN if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \ ls -la target/ . && \ pwd \ ; fi - + RUN if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \ mv bin/armhf-bin/lldap target/lldap && \ mv bin/armhf-bin/migration-tool target/migration-tool && \ @@ -52,7 +52,7 @@ RUN set -x \ && for file in $(cat /lldap/app/static/libraries.txt); do wget -P app/static "$file"; done \ && for file in $(cat /lldap/app/static/fonts/fonts.txt); do wget -P app/static/fonts "$file"; done \ && chmod a+r -R . - + FROM alpine:3.16 WORKDIR /app ENV UID=1000 @@ -104,3 +104,4 @@ VOLUME ["/data"] WORKDIR /app ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"] CMD ["run", "--config-file", "/data/lldap_config.toml"] +HEALTHCHECK CMD ["/app/lldap", "run", "--config-file", "/data/lldap_config.toml"] diff --git a/.github/workflows/Dockerfile.ci.debian b/.github/workflows/Dockerfile.ci.debian index 4beb101..7a1b6ff 100644 --- a/.github/workflows/Dockerfile.ci.debian +++ b/.github/workflows/Dockerfile.ci.debian @@ -17,7 +17,7 @@ RUN if [ "${TARGETPLATFORM}" = "linux/amd64" ]; then \ ls -la target/ . && \ pwd \ ; fi - + RUN if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \ mv bin/aarch64-bin/lldap target/lldap && \ mv bin/aarch64-bin/migration-tool target/migration-tool && \ @@ -26,7 +26,7 @@ RUN if [ "${TARGETPLATFORM}" = "linux/arm64" ]; then \ ls -la target/ . && \ pwd \ ; fi - + RUN if [ "${TARGETPLATFORM}" = "linux/arm/v7" ]; then \ mv bin/armhf-bin/lldap target/lldap && \ mv bin/armhf-bin/migration-tool target/migration-tool && \ @@ -51,8 +51,8 @@ WORKDIR /lldap RUN set -x \ && for file in $(cat /lldap/app/static/libraries.txt); do wget -P app/static "$file"; done \ && for file in $(cat /lldap/app/static/fonts/fonts.txt); do wget -P app/static/fonts "$file"; done \ - && chmod a+r -R . - + && chmod a+r -R . + FROM debian:bullseye-slim ENV UID=1000 ENV GID=1000 @@ -69,3 +69,4 @@ VOLUME ["/data"] WORKDIR /app ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"] CMD ["run", "--config-file", "/data/lldap_config.toml"] +HEALTHCHECK CMD ["/app/lldap", "run", "--config-file", "/data/lldap_config.toml"] diff --git a/Dockerfile b/Dockerfile index cd450cb..ddac97f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -64,3 +64,4 @@ EXPOSE ${LDAP_PORT} ${HTTP_PORT} ENTRYPOINT ["/app/docker-entrypoint.sh"] CMD ["run", "--config-file", "/data/lldap_config.toml"] +HEALTHCHECK CMD ["/app/lldap", "run", "--config-file", "/data/lldap_config.toml"]