balena-io-experimental / balena-wpe

Fullscreen WebKit browser with hardware accelerated CSS, WebGL, and HTML5 video for the RaspberryPi 3.
Apache License 2.0
380 stars 77 forks source link

Healthcheck is not workig #51

Open idoodler opened 5 years ago

idoodler commented 5 years ago

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 commented 5 years ago

Ping?

idoodler commented 4 years ago

Ping