Running container in detached mode from compose.yml

I’m starting up a few containers with a docker-compose.yml file and would like at least some of them to start in detached mode.

I can pass this at command line with

docker-compose up -d

But I wonder if it’s possible to specify this sort of thing in the yml file?

3 Likes

I also have this question. Is it not possible?

Is there anybody out there that can answer the question. I too would like to know if its possible to declare detached mode in the compose YAML file.

FD

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

For docker-compose deployments, all supported configuration items are listed here:

There is no mystery about this: something not listed in the refence, is simply something that is not covered by docker compose files.