Deploying Compose to remote hosts
Let’s move the Redis example we run previously into a Compose file:
services: redis: image: redis
The following command will have to be adjusted with regards to the DOCKER_HOST
variable, since a different IP will be allocated to the EC2 instance. The outcome should be the same on another host:
$ DOCKER_HOST="ssh://ec2-user@18.130.80.179" docker compose up [+] Running 2/2 Network chapter10_default Created ...