The project is currently running in the background from this command:
docker-compose up -d
I need to make two changes to their docker-compose.yml
:
- Add a new container
- Update a previous container to have a link to the new container
After changes are made:
NOTE the "<--
" arrows for my changes
web:
build: .
restart: always
command: ['tini', '--', 'rails', 's']
environment:
RAILS_ENV: production
HOST: example.com
EMAIL: [email protected]
links:
- db:mongo
- exim4:exim4.docker # <-- Add link
ports:
- 3000:3000
volumes:
- .:/usr/src/app
db:
image: mongo
restart: always
exim4: # <-------------------------------- Add new container
image: exim4
restart: always
ports:
- 25:25
environment:
EMAIL_USER: [email protected]
EMAIL_PASSWORD: abcdabcdabcdabcd
After making the changes, how do I apply them? (without destroying anything)
I tried docker-compose down && docker-compose up -d
but this destroyed the Mongo DB container... I cannot do that... again... :sob:
docker-compose restart
says it won't recognize any changes made to docker-compose.yml
(Source: https://docs.docker.com/compose/reference/restart/)
docker-compose stop && docker-compose start
sounds like it'll just startup the old containers without my changes?
Test server:
- Docker version: 1.11.2, build b9f10c9/1.11.2
- docker-compose version: 1.8.0, build f3628c7
Production server is likely using older versions, unsure if that will be an issue?