use docker-compose.yml docker swarm code example Example: docker swarm deploy docker stack deploy -c "path to compose" stackname