consul/testing/deployer/sprawl/internal/tfgen/templates/container-app.tf.tmpl

26 lines
534 B
Cheetah

resource "docker_container" "{{.Node.DockerName}}-{{.Service.ID.TFString}}" {
name = "{{.Node.DockerName}}-{{.Service.ID.TFString}}"
network_mode = "container:${docker_container.{{.PodName}}.id}"
image = docker_image.{{.ImageResource}}.image_id
restart = "on-failure"
{{- range $k, $v := .Labels }}
labels {
label = "{{ $k }}"
value = "{{ $v }}"
}
{{- end }}
env = [
{{- range .Service.Env }}
"{{.}}",
{{- end}}
]
command = [
{{- range .Service.Command }}
"{{.}}",
{{- end }}
]
}