# Docker-Compose Startup Delay

**URL:** <https://forums.balena.io/t/docker-compose-startup-delay/100607>\
**Category:** Product support\
**Tags:** docker-compose\
**Created:** [April 27, 2020, 11:17am UTC](https://forums.balena.io/t/docker-compose-startup-delay/100607 "2020-04-27T11:17:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexdummett](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@alexdummett](https://forums.balena.io/u/alexdummett)\
**Post date:** [April 27, 2020, 11:17am UTC](https://forums.balena.io/t/docker-compose-startup-delay/100607/1 "2020-04-27T11:17:38Z")

</div>

Hi,

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'
volumes: 
    resin-data:
services:
  boxBoot:
    build: ./box-boot
    privileged: true 
    restart: no
    network_mode: host
    labels: 
      io.balena.features.supervisor-api: '1'
  boxFTP:
    build: ./box-ftp
    depends_on: 
      - "boxBoot"
    command: ["sleep 5"]
    privileged: false
    restart: always
    network_mode: host
    expose:
      - "21"
    volumes:
      - 'resin-data:/data'
    labels: 
      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.

---

<div class="post-metadata">

**Author:** ![zvin](https://avatars.discourse-cdn.com/v4/letter/z/a5b964/32.png) [@zvin](https://forums.balena.io/u/zvin)\
**Post date:** [April 27, 2020, 11:58am UTC](https://forums.balena.io/t/docker-compose-startup-delay/100607/2 "2020-04-27T11:58:42Z")

</div>

Hello,  
The `command` key of a docker-compose file overrides the command of the container, it is not “prepended”: [https://docs.docker.com/compose/compose-file/#command](https://docs.docker.com/compose/compose-file/#command)  
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.
