balena-wpe icon indicating copy to clipboard operation
balena-wpe copied to clipboard

Healthcheck is not workig

Open idoodler opened this issue 5 years ago • 2 comments

My project is based balena-wpe, it displays a website served from another service. I added my webserver to the depends_on property, to ensure the webserver is up and running I utilized healthcheck. Yoiu can find my docker-composer.yml attached below.

version: '2.1'
services:
  Browser:
    restart: always
    build: ./balena-wpe
    privileged: true
    network_mode: host
    environment:
      INITSYSTE: on
      WPE_URL: http://localhost:90
    depends_on:
      - Webserver
    healthcheck:
      test: ["CMD", "wget", "-q", "-O", "/dev/null", "$WPE_URL"]
  Webserver:
    restart: always
    build: ./Webserver
    privileged: true
    network_mode: host

It works when I replace the healthcheck property with:

command: >
      /bin/bash -c "
        while ! wget -O /dev/null $WPE_URL > /dev/null;
        do
          echo 'Waiting for Webserver to be ready...';
          sleep 10;
          exit 1;
        done;
        echo 'Webserver up, starting the Browser now!';
        /wpe-init
      "

I can't see any error in the balena-cloud console.

idoodler avatar Jul 26 '19 12:07 idoodler

Ping?

idoodler avatar Sep 13 '19 19:09 idoodler

Ping

idoodler avatar Sep 29 '19 08:09 idoodler