Skip to content

Commit

Permalink
fix: db port when ftl serve creates from scratch (#558)
Browse files Browse the repository at this point in the history
Fixes #557 

We weren't setting the port correctly after a new db had been created.
  • Loading branch information
wesbillman authored Nov 6, 2023
1 parent 4c3c3e0 commit a360e0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/ftl/cmd_serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (s *serveCmd) setupDB(ctx context.Context) (string, error) {
}

recreate := s.Recreate
port := ""
port := fmt.Sprintf("%d", s.DBPort)

if len(output) == 0 {
logger.Infof("Creating docker container '%s' for postgres db", ftlContainerName)
Expand All @@ -113,7 +113,7 @@ func (s *serveCmd) setupDB(ctx context.Context) (string, error) {
"--user", "postgres",
"--restart", "always",
"-e", "POSTGRES_PASSWORD=secret",
"-p", fmt.Sprintf("%d:5432", s.DBPort),
"-p", fmt.Sprintf("%s:5432", port),
"--health-cmd=pg_isready",
"--health-interval=1s",
"--health-timeout=60s",
Expand Down

0 comments on commit a360e0c

Please sign in to comment.