I wanted to use docker-compose
to spin up new instances of my containers, but with slightly different parameters, so I essentially copied the entire project folder, made changes to my Docker compose file, and did docker-compose up --build
but no matter which project folder I run that in, it only recreates the containers rather than spinning up new ones.
Below is my compose file. In one project folder it's this, and in the other, I changed container-name
to app-test-client
and app-test-api
as well as changing the ports (e.g. 8080:80
), so why does it recreate instead of spinning up new containers? I want to see both app-client
and app-test-client
running.
version: '3.2'
services:
client:
build:
context: ./client
container_name: app-client
ports:
- '80:80'
- '5432:5432'
- '443:443'
links:
- api
api:
build:
context: ./api
container_name: app-api
volumes:
- ~/.ssh:/root/.ssh
environment:
# read from ./.env file if it exists
- EDR_ENVIRONMENT=${EDR_ENV}
- SAS_ENVIRONMENT=${SAS_ENV}
command: ['node', '.']