By creating Contexts to remote devices, the stack can be deployed to remote machines without having to copy the generated
docker-compose.yml file to them.
-
Create an SSH Docker Context using:
docker context create <name_of_context> --docker "host=ssh://<user>@<remote-machine_ip or hostname>
-
Copy the generated configurations to the remote machine (see Caveats above in order to avoid filesystem mismatch errors). No need to copy the
docker-compose.ymlfile -
Deploy the Compose application using:
docker --context=<name_of_context_from_above> compose --project-directory=deploy up -d