mirror of https://github.com/status-im/consul.git
35 lines
791 B
Cheetah
35 lines
791 B
Cheetah
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
|
|
}
|
|
}
|