2

I would like to first create a Digital Ocean droplet(server) and then create multiple docker containers for various services inside that server.

I feel like this should be easy but I cannot find any examples of others doing this. Any help would be greatly appreciated.

1 Answer 1

1

You cannot really nest resources like that in Terraform. You have a two different ways to approach this, I would use the user_data argument that will run a script on your droplet that will issue the docker commands to pull down your container images and start your containers. Here is a blog post with an example.

Hope this helps.

Sign up to request clarification or add additional context in comments.

1 Comment

I was afraid that might be the answer. Thanks Jamie.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.