From de86f4f5d96d95bcad83c3903268d332d3d8697d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= <1005065+DeepDiver1975@users.noreply.github.com> Date: Fri, 26 Apr 2024 12:26:58 +0200 Subject: [PATCH] fix: use docker healthcheck --- .../entrypoint-override.sh | 19 --------------- .../entrypoint-override.sh | 19 --------------- .../examples/ocis_wopi/docker-compose.yml | 24 +++++++++---------- 3 files changed, 12 insertions(+), 50 deletions(-) delete mode 100755 deployments/examples/ocis_wopi/config/ocis-appprovider-collabora/entrypoint-override.sh delete mode 100755 deployments/examples/ocis_wopi/config/ocis-appprovider-onlyoffice/entrypoint-override.sh diff --git a/deployments/examples/ocis_wopi/config/ocis-appprovider-collabora/entrypoint-override.sh b/deployments/examples/ocis_wopi/config/ocis-appprovider-collabora/entrypoint-override.sh deleted file mode 100755 index ebf446c9b..000000000 --- a/deployments/examples/ocis_wopi/config/ocis-appprovider-collabora/entrypoint-override.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -set -e - -apk add curl - -#TODO: app driver itself should try again until Collabora is up... - -retries=10 -while [[ $retries -gt 0 ]]; do - if curl --silent --show-error --fail http://collabora:9980/hosting/discovery > /dev/null; then - ocis app-provider server - else - echo "Collabora is not yet available, trying again in 10 seconds" - sleep 10 - retries=$((retries - 1)) - fi -done -echo 'Collabora was not available after 100 seconds' -exit 1 diff --git a/deployments/examples/ocis_wopi/config/ocis-appprovider-onlyoffice/entrypoint-override.sh b/deployments/examples/ocis_wopi/config/ocis-appprovider-onlyoffice/entrypoint-override.sh deleted file mode 100755 index 8df12d70c..000000000 --- a/deployments/examples/ocis_wopi/config/ocis-appprovider-onlyoffice/entrypoint-override.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -set -e - -apk add curl - -#TODO: app driver itself should try again until OnlyOffice is up... - -retries=10 -while [[ $retries -gt 0 ]]; do - if curl --silent --show-error --fail http://onlyoffice/hosting/discovery > /dev/null; then - ocis app-provider server - else - echo "OnlyOffice is not yet available, trying again in 10 seconds" - sleep 10 - retries=$((retries - 1)) - fi -done -echo 'OnlyOffice was not available after 100 seconds' -exit 1 diff --git a/deployments/examples/ocis_wopi/docker-compose.yml b/deployments/examples/ocis_wopi/docker-compose.yml index 02bf4a0a8..c8354acc3 100644 --- a/deployments/examples/ocis_wopi/docker-compose.yml +++ b/deployments/examples/ocis_wopi/docker-compose.yml @@ -110,10 +110,6 @@ services: image: owncloud/ocis:${OCIS_DOCKER_TAG:-latest} networks: ocis-net: - user: "0" # needed for apk add in entrypoint script - entrypoint: - - /bin/sh - - /entrypoint-override.sh command: app-provider server environment: # use the internal service name of the gateway @@ -133,22 +129,20 @@ services: # share the registry with the ocis container MICRO_REGISTRY_ADDRESS: ocis:9233 volumes: - - ./config/ocis-appprovider-collabora/entrypoint-override.sh:/entrypoint-override.sh - ocis-config:/etc/ocis logging: driver: ${LOG_DRIVER:-local} restart: always depends_on: - - ocis + ocis: + condition: service_started + collabora: + condition: service_healthy ocis-appprovider-onlyoffice: image: owncloud/ocis:${OCIS_DOCKER_TAG:-latest} networks: ocis-net: - user: "0" # needed for apk add in entrypoint script - entrypoint: - - /bin/sh - - /entrypoint-override.sh #command: app-provider server environment: # use the internal service name of the gateway @@ -168,13 +162,15 @@ services: # share the registry with the ocis container MICRO_REGISTRY_ADDRESS: ocis:9233 volumes: - - ./config/ocis-appprovider-onlyoffice/entrypoint-override.sh:/entrypoint-override.sh - ocis-config:/etc/ocis logging: driver: ${LOG_DRIVER:-local} restart: always depends_on: - - ocis + ocis: + condition: service_started + onlyoffice: + condition: service_healthy wopiserver: image: cs3org/wopiserver:${WOPISERVER_DOCKER_TAG:-v10.3.0} @@ -224,6 +220,8 @@ services: logging: driver: ${LOG_DRIVER:-local} restart: always + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9980/hosting/discovery"] onlyoffice: image: onlyoffice/documentserver:7.5.0 @@ -251,6 +249,8 @@ services: logging: driver: ${LOG_DRIVER:-local} restart: always + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost/hosting/discovery"] tika: image: ${TIKA_IMAGE:-apache/tika:latest-full}