Skip to content

Commit

Permalink
fix: fix the issue where the FE container is not utilizing the "unles…
Browse files Browse the repository at this point in the history
…s-stopped" restart policy
  • Loading branch information
DesnLee committed Sep 15, 2023
1 parent dca3589 commit fe1ed7f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions docker/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ func (c *Container) StartImage() {
Image: c.ImageName + ":" + c.Version,
}

hostConfig := &container.HostConfig{}
hostConfig := &container.HostConfig{
RestartPolicy: container.RestartPolicy{
Name: "unless-stopped",
},
}

switch c.ContainerType {
case vars.ContainerTypeFE:
Expand All @@ -141,9 +145,6 @@ func (c *Container) StartImage() {
case vars.ContainerTypeBE:
configDir := filepath.Join(vars.ConfigDir, c.Name)
hostConfig.Binds = append(hostConfig.Binds, configDir+":/app/config")
hostConfig.RestartPolicy = container.RestartPolicy{
Name: "unless-stopped",
}
hostConfig.PortBindings = nat.PortMap{
"3000/tcp": []nat.PortBinding{
{
Expand Down
2 changes: 1 addition & 1 deletion vars/vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

const (
Version = "0.0.8"
Version = "0.0.9"
DockerNameBE = "ssm-backend"
DockerNameFE = "ssm-frontend"
ContainerTypeFE = "frontend"
Expand Down

0 comments on commit fe1ed7f

Please sign in to comment.