From the course: DevOps Foundations: Your First Project

Unlock the full course today

Join today to access over 24,600 courses taught by industry experts.

Adding OpenTofu to Docker Compose

Adding OpenTofu to Docker Compose

Now that we got the version of OpenTofu to use, let's go ahead and add it to our docker-compose.yaml. To do that, I'm going to type "vim", then "docker-compose.yaml" to open it in my editor. Next I'm going to look for the OpenTofu service. It should be pretty early in the manifest file. However, if you cannot find it, all you have to do is search for it, like I did here. So let's move to the image line down here. To save time, I went ahead and created the OpenTofu service for you However, you might be using an older version of OpenTofu in your copy of the exercise files. If that's the case, simply remove the version that's there and replace it with the version that we found on GitHub. Next, let's pay attention to the volumes that we're mounting down here. The first volume that we're mounting is this "website" folder. That's where our website is. The second folder is the folder that we're going to use to store our configuration code that's going to get Explore California into the…

Contents