-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeployment.mustache
More file actions
27 lines (27 loc) · 997 Bytes
/
deployment.mustache
File metadata and controls
27 lines (27 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
services:
{{.ContainerName}}:
image: {{.ImageName}}:{{.ImageTag}}
container_name: {{.ContainerName}}
restart: always
{{if .ExtrasHosts}}extra_hosts:{{range $index, $val := .ExtrasHosts}}
- "{{.}}"{{end}}{{end}}
deploy:
resources:
limits:
cpus: "{{.CpuLimit}}"
memory: "{{.MemoryLimit}}"
healthcheck:
test: ["CMD", "curl", "-f", "{{.HealthCheckUrl}}"]
interval: {{.HealthCheckInterval}}
timeout: {{.HealthCheckTimeout}}
retries: {{.HealthCheckRetries}}
start_period: {{.HealthCheckStartPeriod}}
{{if .BindContainerPort}}ports:{{range $index, $val := .BindContainerPort}}
- "{{.}}"{{end}}{{end}}
{{if .BindVolumes}}volumes:{{range $index, $val := .BindVolumes}}
- "{{.}}"{{end}}{{end}}
{{if .Environment}}environment: {{range $key, $val := .Environment}}
{{$key}}: "{{$val}}"{{end}}{{end}}
{{if .Volumes}}volumes:{{range $index, $val := .Volumes}}
{{.}}{{end}}
{{end}}