Wee service not waiting for python flask service to start


Just getting to grips with balenaCloud and have an issue where a multi-container system does not appear to honour the ‘depends_on’ flag. I have had a good search of this forum and don’t seem to find anything that resolves this issue.

I have a python service called ‘frontend’ and another called ‘wpe’ which is the full-screen WebKit browser. The wpe service has the ‘depends_on’ set as frontend, but on reboot or refresh it seems to load without waiting for the python service to fully start (and thus a blank screen). If I manually restart the wpe service, then it loads as expected.

What options are there to have the service wait until the python main has started and, even better, restart every time the python service restarts?

Current docker-compose.yml is:

version: '2'
    restart: always
    build: ./frontend
    privileged: true
    network_mode: host
      - "8080"
    restart: always
    build: ./wpe
    privileged: true
    network_mode: host
      - frontend

Many thanks.

Hi @branchespark, welcome to the balena community : )

I think Pablo’s response here is applicable for your scenario as well:

Docker also provides some hints on how to make this work with external tools / scripts:

As for balena: Right now depends_on controls the order services are started, but it doesn’t restart dependent services. We have an internal feature request about it. I’ll add your +1 to that and notify here when we release it.

I hope that one of the workarounds explained in the other thread or by in the docker docs is sufficient for now. Let us know how you proceed with it.