Docker-Compose Startup Delay


I am building a small FTP device for file storage which uses NODE.JS to control and OLED screen and a small FTP server. These all work fine, but I want the FTP server to start-up AFTER the OLED screen and monitor and I am struggling to get this to work.

This my compose file:

version: '2'
    build: ./box-boot
    privileged: true 
    restart: no
    network_mode: host
      io.balena.features.supervisor-api: '1'
    build: ./box-ftp
      - "boxBoot"
    command: ["sleep 5"]
    privileged: false
    restart: always
    network_mode: host
      - "21"
      - 'resin-data:/data'
      io.balena.features.supervisor-api: '1'

The problem is that the SLEEP command can not be found, and I don’t know how to introduce a delay. The boxBoot is not a server, it is simply a service monitor with an OLED screen showing output. I use two separate containers, because I will be adding more dockers with more services. This is just an example of a two docker process.

Has anyone had any luck in delaying the startup of a second service? Help much appreciated.

The command key of a docker-compose file overrides the command of the container, it is not “prepended”:
You need to update the Dockerfile in the box-ftp folder and change the CMD or ENTRYPOINT here to point to a shell script that will sleep 5 then run the command it is supposed to run.
If sleep is not available, you need to install it in the Dockerfile. On debian it is in the coreutils package for example.