I would like to create 2 containers with almost same settings except environment variables.
Tried severals things without success especially the .override.yml (passing multiple .yml to docker-compose overriding the previous one).
# docker-compose.yml
version: '3.7'
services:
web:
image: nginx
container_name: test-web
ports:
- 80:80
Now the other one
# docker-compose.override.yml
version: '3.7'
services:
web:
container_name: dupe-web
ports:
- 8080:80
Doing :
$ docker-compose -f docker-compose.yml -f docker-compose.override.yml up -d
Recreating test-web ... done
Kills me the test-web container and starts the new one name dupe-web.
Is there a way to have both launched using same service?
In my case I would like to create two containers:
- one for developers
- one for staging (almost same settings except env as said)
Any help would be welcome.