You might have noticed that I already incorporated these steps in the user_data
/ cloud-init
script so we’re all good to go.
As with Docker, normally you would not install this via cloud-init, simply because it is too specialized. Everything you do via cloud-init will end up on every server you rollout, and not every server is a Docker server (or it might be in your case, but more often it is not).
Compose files
Preferable we would want to run as little docker
commands as possible. As we did with Terraform before, we would like to put our configuration in code and then use a single command to spin up a bunch of containers, that are connected and work together. Well, you’ve probably guessed it, this is where Docker compose and it compose files come in.
A compose file is in YAML format, which is hated by a lot of developers (first hit on Google), but is used about everywhere and also for compose we’ll need to work with it. This is the general idea:
- Create a compose file named
docker-compose.yaml
Henk Batelaan