Let's say i have two different docker-compose
configurations:
db.yml
:
version: '3'
networks:
default:
external:
name: backend
volumes:
mongo_data:
services:
mongodb:
image: mongodb
container_name: mongodb
restart: always
ports:
- 27017:27017
networks:
- backend
volumes:
- mongo_data:/data/db
admin.yml
:
version: '3'
networks:
default:
external:
name: backend
volumes:
mongo_data:
services:
mongoclient:
image: mongoclient/mongoclient
restart: always
ports:
- 3000:3000
networks:
- backend
depends_on:
- mongodb
links:
- mongodb
This won't work, because the linked container is not configured in the same file. But is there a way to achieve something similar?
I'd like to have a cleaner setup for setting up my production environment so that i am able to restart only the relevant bits that changed and not everything at once.