You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
consul/testing/deployer/sprawl/internal/tfgen/templates/container-proxy.tf.tmpl

35 lines
791 B

resource "docker_container" "{{.DockerNetworkName}}-forwardproxy" {
name = "{{.DockerNetworkName}}-forwardproxy"
image = docker_image.nginx.image_id
restart = "always"
dns = ["8.8.8.8"]
ports {
internal = {{.InternalPort}}
}
network_mode = "bridge"
networks_advanced {
name = docker_network.{{.DockerNetworkName}}.name
ipv4_address = "{{.IPAddress}}"
}
env = [
{{- range .Env }}
"{{.}}",
{{- end}}
]
volumes {
host_path = abspath("nginx-config-{{.Name}}/nginx.conf")
container_path = "/etc/nginx/conf.d/default.conf"
read_only = true
}
}
output "forwardproxyport_{{.Name}}" {
value = {
for port in docker_container.{{.DockerNetworkName}}-forwardproxy.ports : port.internal => port.external
}
}