diff --git a/dockercompose/graphql.go b/dockercompose/graphql.go index e463d6f9..9076e5e3 100644 --- a/dockercompose/graphql.go +++ b/dockercompose/graphql.go @@ -2,6 +2,7 @@ package dockercompose import ( "fmt" + "strings" "github.com/nhost/be/services/mimir/model" "github.com/nhost/be/services/mimir/schema/appconfig" @@ -117,6 +118,13 @@ func console( //nolint:funlen return nil, fmt.Errorf("failed to get hasura env vars: %w", err) } + extraHosts := extraHosts(subdomain) + for i, host := range extraHosts { + if strings.HasPrefix(host, subdomain+".hasura") { + extraHosts[i] = subdomain + ".hasura.local.nhost.run:0.0.0.0" + } + } + env := make(map[string]string, len(envars)) for _, v := range envars { if v.Name == "HASURA_GRAPHQL_CORS_DOMAIN" && v.Value != "*" { @@ -149,7 +157,7 @@ func console( //nolint:funlen }, EntryPoint: nil, Environment: env, - ExtraHosts: extraHosts(subdomain), + ExtraHosts: extraHosts, HealthCheck: &HealthCheck{ Test: []string{ "CMD-SHELL", diff --git a/dockercompose/graphql_test.go b/dockercompose/graphql_test.go index b5c4dc38..b8877770 100644 --- a/dockercompose/graphql_test.go +++ b/dockercompose/graphql_test.go @@ -194,7 +194,7 @@ func expectedConsole() *Service { "dev.db.local.nhost.run:host-gateway", "dev.functions.local.nhost.run:host-gateway", "dev.graphql.local.nhost.run:host-gateway", - "dev.hasura.local.nhost.run:host-gateway", + "dev.hasura.local.nhost.run:0.0.0.0", "dev.storage.local.nhost.run:host-gateway", }, HealthCheck: &HealthCheck{