I have a docker-compose.override.yml file that launches 10 different services that only differ in the name of the container and the command they run. They also need various envrionments variables, several volumes etc.
The file looks like this, but it has 10 section and each section actually has more configuration.
I don't like all that repetition.
Is there a way to move all the common configuration part to some other place and let all the services use this information?
Maybe some other solution to this?
version: "3"
services:
service-1:
image: my-image
tty: true
environment:
- APP_ENVIRONMENT=dev
working_dir: /source
volumes:
- .:/source:ro
command: run_services_1
service-2:
image: my-image
tty: true
environment:
- APP_ENVIRONMENT=dev
working_dir: /source
volumes:
- .:/source:ro
command: run_services_2