Skip to content

Commit

Permalink
fix(service): use env_file and container_name in duplication and crea…
Browse files Browse the repository at this point in the history
…tion_by_file (#129)
  • Loading branch information
RomainDreidemy authored Sep 15, 2023
1 parent 252a93e commit 7420c50
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 17 deletions.
16 changes: 9 additions & 7 deletions api/src/services/create_by_file/create_stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,15 @@ func createServices(composeServices map[string]models.DockerComposeService, stac
image := strings.Split(composeService.Image, ":")

services = append(services, models.Service{
StackID: stackId,
Name: key,
DockerImage: image[0],
DockerTag: image[1],
Entrypoint: composeService.Entrypoint,
PositionY: 10,
PositionX: float32(250*(index) + 10),
StackID: stackId,
Name: key,
ContainerName: composeService.ContainerName,
DockerImage: image[0],
DockerTag: image[1],
EnvFile: composeService.EnvFile,
Entrypoint: composeService.Entrypoint,
PositionY: 10,
PositionX: float32(250*(index) + 10),
})

index += 1
Expand Down
22 changes: 12 additions & 10 deletions api/src/services/duplication/duplication.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,18 @@ func DuplicateStack(stack models.Stack) models.Stack {

func duplicateService(service models.Service, stackId string) models.Service {
return models.Service{
StackID: stackId,
Name: service.Name,
Description: service.Description,
DockerImage: service.DockerImage,
DockerTag: service.DockerTag,
Entrypoint: service.Entrypoint,
Context: service.Context,
Dockerfile: service.Dockerfile,
PositionX: service.PositionX,
PositionY: service.PositionY,
StackID: stackId,
Name: service.Name,
ContainerName: service.ContainerName,
Description: service.Description,
DockerImage: service.DockerImage,
DockerTag: service.DockerTag,
EnvFile: service.EnvFile,
Entrypoint: service.Entrypoint,
Context: service.Context,
Dockerfile: service.Dockerfile,
PositionX: service.PositionX,
PositionY: service.PositionY,
}
}

Expand Down

0 comments on commit 7420c50

Please sign in to comment.