Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use proper hostname as IP
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <[email protected]>
frouioui committed Dec 19, 2023
1 parent 6b3a6b7 commit 830c39e
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -9,8 +9,9 @@ services:
image: "vitess-bot-image"
container_name: "vitess-bot-container"
volumes:
- "./.data:/.data"
- "./.env:/.env"
- "./out.log:/out.log"
- "./.data:/.data"
- "./config:/config"
- "./tools:/tools"
network_mode: bridge
5 changes: 4 additions & 1 deletion go/config.go
Original file line number Diff line number Diff line change
@@ -69,7 +69,10 @@ func readConfig() (*config, error) {
// Get server address
serverAddress := os.Getenv("SERVER_ADDRESS")
if serverAddress == "" {
serverAddress = "127.0.0.1"
serverAddress, err = os.Hostname()
if err != nil {
return nil, errors.Wrap(err, "could not resolve hostname")
}
}
c.address = serverAddress

0 comments on commit 830c39e

Please sign in to comment.