I have a docker-compose.yml
file which is setup for two environments, dev
and prod
:
docker-compose.yml
Contains shared configuration for both environments
version: '3.1'
services:
homeassistant:
restart: unless-stopped
privileged: true
network_mode: host
docker-compose.dev.yml
Contains configuration for development environment
version: '3.1'
services:
homeassistant:
image: registry.gitlab.com/addisonlynch/homeassistant/hass:dev
container_name: hass-dev
docker-compose.prod.yml
Contains configuration for production environment
version: '3.1'
services:
homeassistant:
image: registry.gitlab.com/addisonlynch/homeassistant/hass:prod
container_name: hass-prod
I can run the dev environment as follows:
docker-compose -f docker-compose.yml -f docker-compose.dev.yml up
and the prod environment:
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up
Both of the environments run flawlessly, however I can only have one running at the same time. If I try to spin up prod while dev is running (on the same host), the dev containers will exit and prod containers will start (effectively replacing them). How do I run both environments at the same time?