Multiple docker composes

Hello together,

right now I have the two following docker questions:

  1. When I restart the machine somehow all the dockers are running at start without having them setup as a service. Do you know where this comes from?

docker run -d --restart unless-stopped --stop-timeout 300 --name STORJ-01 -e WALLET=“0x…2” -e EMAIL=“…” -e STORAGE=“8TB” --user $(id -u):$(id -g) --log-opt max-size=30m --mount type=bind,source=“/mnt/5…R/STORJ-01/Identity/storagenode”,destination=/app/identity --mount type=bind,source=“/mnt/5…R/STORJ-01-Daten”,destination=/app/config storjlabs/storagenode:latest

This is kinda the docker run which I am using.

  1. As you know it is possible to put all the running dockers into one docker compose.yml.

Is it possible to create multiple of these .yml’s? Like compose2.yml and so on. Some dockers require others to start first like the exporter-docker. So it would be wise to put them into a second compose2.yml.

Thanks and kind regards,

  1. it’s a feature* of restart policy Docker run reference | Docker Documentation

  2. sure you can, if you do you’ll have to specify the compose file like docker-compose -f /path/docker-compose2.yaml

You can also have a single compose file and use depends_on to specify the dependency between containers basically which one should start first Compose file version 3 reference | Docker Documentation

1 Like

There are multiple Compose realisations.

Would you prefer the Compose Plugin or the docker-compose apt?

good point, I should migrate to “docker compose” as I see that there are talks about deprecating “docker-compose”
as for your case, (beside the obvious whatever works for you :slight_smile: ) if you can, try “docker compose” so that you don’t have to change it in the future