I’m really not sure if you guys still have a doubt on this.
But, docker-compose up -d worked pretty well for me.
I am using it in a jenkins pipeline, taking everything from a docker-compose.yml file
Hope this helps someone with same doubt.
there is information available on official docker docs page https://docs.docker.com/compose/reference/up/ too
In your docker-compose.yml set attach: false as a top-level configuration under the service you wish to detach.
This was introduced in version 2.20.
For instance, if you wanted Redis as a service, but did not want to see the Redis logs in your terminal, your compose file would look something like this.