Skip to content

Commit

Permalink
feat: added RestartPolicy "unless-stopped" to all containers bef… (pa…
Browse files Browse the repository at this point in the history
…thwar#292)

feat: added RestartPolicy "unless-stopped" to all containers before up
  • Loading branch information
moul authored Dec 2, 2019
2 parents 4b2c904 + 28de105 commit 063011e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions go/pkg/pwcompose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ func Up(preparedCompose string, instanceKey string, logger *zap.Logger) error {
serviceName := service.Labels[serviceNameLabel]
imageHash := strings.Split(service.Image, "@sha256:")[1]
service.ContainerName = fmt.Sprintf("%s.%s.%s.%s", challengeName, serviceName, imageHash[:6], instanceKey)
service.Restart = "unless-stopped"
service.Labels[instanceKeyLabel] = instanceKey
preparedComposeStruct.Services[name] = service
}
Expand Down
1 change: 1 addition & 0 deletions go/pkg/pwcompose/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type service struct {
DependsOn []string `yaml:"depends_on,omitempty"`
CapAdd []string `yaml:"cap_add,omitempty"`
Build string `yaml:",omitempty"`
Restart string `yaml:",omitempty"`
Environment map[string]string `yaml:",omitempty"`
Labels map[string]string `yaml:"labels,omitempty"`
}
Expand Down

0 comments on commit 063011e

Please sign in to comment.