@@ -12,6 +12,7 @@ import (
1212 "github.com/arduino/go-paths-helper"
1313 "github.com/docker/docker/api/types/container"
1414 dockerClient "github.com/docker/docker/client"
15+ "github.com/gosimple/slug"
1516 "go.bug.st/f"
1617 "gopkg.in/yaml.v3"
1718)
@@ -112,6 +113,7 @@ func generateMainComposeFile(ctx context.Context, app parser.App, pythonImage st
112113 Ports []string `yaml:"ports"`
113114 User string `yaml:"user"`
114115 Entrypoint string `yaml:"entrypoint"`
116+ ExtraHosts []string `yaml:"extra_hosts,omitempty"`
115117 }
116118 type mainService struct {
117119 Main service `yaml:"main"`
@@ -134,7 +136,12 @@ func generateMainComposeFile(ctx context.Context, app parser.App, pythonImage st
134136
135137 // Merge compose
136138 mainAppCompose .Include = composeFiles .AsStrings ()
137- mainAppCompose .Name = app .Name
139+
140+ composeProjectName , err := app .FullPath .RelFrom (orchestratorConfig .AppsDir ())
141+ if err != nil {
142+ return fmt .Errorf ("failed to get compose project name: %w" , err )
143+ }
144+ mainAppCompose .Name = slug .Make (composeProjectName .String ())
138145 if err := writeMainCompose (); err != nil {
139146 return err
140147 }
@@ -162,6 +169,7 @@ func generateMainComposeFile(ctx context.Context, app parser.App, pythonImage st
162169 Entrypoint : "/run.sh" ,
163170 DependsOn : services ,
164171 User : getCurrentUser (),
172+ ExtraHosts : []string {"msgpack-rpc-router:host-gateway" },
165173 },
166174 }
167175 return writeMainCompose ()
0 commit comments