There are dev-docker-compose, want to do testing-docker-compose, but you need to volumes database was new - not to use the previous - how?

I have dev-docker-compose.yml there are several servers, several databases: postgres, redis etc...
now I want to create a test-docker-compose.yml I changed the names of the containers/services, for example now this:

postgres:
image: postgres
restart: always
ports:
- "5432:5432"
volumes:
- postgres:/var/lib/postgresql/data

and now i have changed it to

test_postgres:
image: postgres
restart: always
ports:
- "5432:5432"
volumes:
- test_postgres:/var/lib/postgresql/data

but when I go into the database via navicat or dbeaver, no matter what - I see the same data that was in the first version dev-docker-compose.

ie how do I create the same services with pomoshju the new compose. but that database was new? this is for the start of testing. I don't need to change or delete the previous compose. just skip the tests and everything in a new empty databases
March 23rd 20 at 19:04
1 answer
March 23rd 20 at 19:06
Explicitly specify the port:

version: '3.5'
services:
postgres1:
 image: postgres:9.6
environment:
 POSTGRES_PASSWORD: example1
 ports: 
 - "5000:5432"

postgres2:
 image: postgres:9.6
environment:
 POSTGRES_PASSWORD: example2
ports:
 - "5001:5432"
and what do you mean clearly? to change to another just ? It is because of the port number - it pulls the same volumes?
after all, the previous container on the same port is disabled and all on the idea when creating a new container( with a different name) is not important because what is a port? - Chester76 commented on March 23rd 20 at 19:09
@Chester76, I thought it was necessary two containers in parallel DBMS.
Second off, exactly? - Don commented on March 23rd 20 at 19:12
@Don, just off docker ps shows the zero running - Chester76 commented on March 23rd 20 at 19:15
@Chester76start so
$ docker-compose-f docker-compose-testing.yml up-d --build
? - Don commented on March 23rd 20 at 19:18

Find more questions by tags DevOpsDockerTesting software