I can deploy the application with Docker Compose on a development laptop by specifying multiple Compose files—the core file and the local override. In swarm mode, you use the standard docker command, rather than docker-compose to deploy a stack. The Docker CLI doesn't support multiple files for stack deployment, but I can generate a single stack file by using Docker Compose to join the source files together. This command generates a single Compose file called docker-stack.yml from the two Compose files for the stack deployment:
docker-compose -f docker-compose.yml -f docker-compose.swarm.yml config > docker-stack.yml
Docker Compose joins the input files and checks whether the output configuration ...