Created
May 30, 2019 02:44
-
-
Save darkn3rd/4c276dbe5bbbf15d98e2cd081bc7d38a to your computer and use it in GitHub Desktop.
Terraform Docker Sample
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "docker" {} | |
# declare any input variables | |
# create docker volume resource | |
# create docker network resource | |
# create db container | |
resource "docker_container" "db" { | |
name = "db" | |
image = "mysql:5.7" | |
restart = "always" | |
} | |
# create wordpress container | |
resource "docker_container" "wordpress" { | |
name = "wordpress" | |
image = "wordpress:latest" | |
restart = "always" | |
ports = { | |
internal = "80" | |
external = "8080" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you have a typo on line 21 - if I try to run it as is
removing the
=
to turn it from an assignment into a block allows it to work properly.