Terraform can also be used to manipulate Docker. The classical usage is against an already running Docker server on the network, but it will work exactly the same locally with your own Docker installation. Using Terraform for controlling Docker, we'll be able to dynamically trigger Docker image updates, execute containers with every imaginable option, manipulate Docker networks, and use Docker volumes.
Here, we'll deploy an isolated blog container (Ghost) that will be publicly served by the
nginx-proxy container over HTTP. This very useful
nginx-proxy container is proposed by Jason Wilder from InfluxDB on his GitHub: https://github.com/jwilder/nginx-proxy.
To step through this recipe, you will need the following: ...