2023-07-17 22:15:22 +00:00
|
|
|
resource "docker_container" "{{.DockerNetworkName}}-forwardproxy" {
|
|
|
|
name = "{{.DockerNetworkName}}-forwardproxy"
|
2023-11-02 19:25:48 +00:00
|
|
|
image = docker_image.nginx.image_id
|
2023-07-17 22:15:22 +00:00
|
|
|
restart = "always"
|
|
|
|
dns = ["8.8.8.8"]
|
|
|
|
|
|
|
|
ports {
|
|
|
|
internal = {{.InternalPort}}
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|