Skip to content

Commit

Permalink
Pass project name for database/nginx compose setup
Browse files Browse the repository at this point in the history
The (autogenerated) project name ".LocalBeach" is invalid, so pass
"LocalBeach" using a CLI parameter.

The "name" top-level element from the compose spec is not supported,
it seems, otherwise it would have been a better solution.
  • Loading branch information
kdambekalns committed Feb 4, 2022
1 parent 41a4377 commit 5a1c418
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/beach/cmd/down.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func handleDownRun(cmd *cobra.Command, args []string) {
}

log.Info("Stopping reverse proxy and database server ...")
commandArgs := []string{"compose", "-f", path.Base + "compose.yaml", "down", "-v"}
commandArgs := []string{"compose", "-f", path.Base + "compose.yaml", "down", "-v", "-p", "LocalBeach"}
output, err := exec.RunCommand("nerdctl", commandArgs)
if err != nil {
log.Fatal(output)
Expand Down
2 changes: 1 addition & 1 deletion cmd/beach/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func startLocalBeach() error {
_ = destination.Close()

log.Info("Starting reverse proxy and database server ...")
commandArgs := []string{"compose", "-f", path.Base + "compose.yaml", "up", "--remove-orphans", "-d"}
commandArgs := []string{"compose", "-f", path.Base + "compose.yaml", "up", "--remove-orphans", "-d", "-p", "LocalBeach"}
err = exec.RunInteractiveCommand("nerdctl", commandArgs)
if err != nil {
return errors.New("container startup failed")
Expand Down

0 comments on commit 5a1c418

Please sign in to comment.