2023-07-17 22:15:22 +00:00
|
|
|
resource "docker_container" "{{.Node.DockerName}}-{{.Service.ID.TFString}}" {
|
|
|
|
name = "{{.Node.DockerName}}-{{.Service.ID.TFString}}"
|
|
|
|
network_mode = "container:${docker_container.{{.PodName}}.id}"
|
2023-11-02 19:25:48 +00:00
|
|
|
image = docker_image.{{.ImageResource}}.image_id
|
2023-07-17 22:15:22 +00:00
|
|
|
restart = "on-failure"
|
|
|
|
|
|
|
|
{{- range $k, $v := .Labels }}
|
|
|
|
labels {
|
|
|
|
label = "{{ $k }}"
|
|
|
|
value = "{{ $v }}"
|
|
|
|
}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
env = [
|
2023-09-06 23:46:34 +00:00
|
|
|
{{- range .Service.Env }}
|
2023-07-17 22:15:22 +00:00
|
|
|
"{{.}}",
|
|
|
|
{{- end}}
|
|
|
|
]
|
|
|
|
|
|
|
|
command = [
|
2023-09-06 23:46:34 +00:00
|
|
|
{{- range .Service.Command }}
|
2023-07-17 22:15:22 +00:00
|
|
|
"{{.}}",
|
|
|
|
{{- end }}
|
|
|
|
]
|
|
|
|
}
|