Just a question. What I want to achieve is to run 3 exactly the same stacks based on the same docker-compose file.
For example, start the app+db 3 times which would be completely independent so that we will end up with 3 apps and 3 dbs overall.
This is what I naturally tried (start 3 apps in parallel):
docker-compose -f tmp/compose-example.yml run --rm app sleep 10&
which produces this:
tmp/example.sh CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b62cb6eabb3b debian "sleep 10" 18 minutes ago Up Less than a second tmp_app_run_10 0cc4d5fd63f3 debian "sleep 10" 18 minutes ago Up 1 seconds tmp_app_run_9 101258f7cb04 debian "sleep 10" 18 minutes ago Up 2 seconds tmp_app_run_8 847a99f7ca52 mongo:2.4 "/entrypoint.sh mongo" 47 minutes ago Up 28 minutes 27017/tcp tmp_db_1
As we can see there are indeed 3 apps, but the dependency (db) is shared across those. So I want to end up with 3 db-s - each matching the appropriate app.
The example compose file is this:
version: '2' services: app: image: debian depends_on: - db db: image: mongo:2.4
So the question is can I stop sharing the same dependency?
Thanks in advance.