Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion dockercompose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"github.com/nhost/be/services/mimir/model"
"github.com/nhost/cli/ssl"
"net/url"
)

const (
Expand Down Expand Up @@ -208,6 +209,18 @@ func traefik(subdomain, projectName string, port uint, dotnhostfolder string) (*
if err := trafikFiles(dotnhostfolder); err != nil {
return nil, fmt.Errorf("failed to create traefik files: %w", err)
}
path := "/var/run/docker.sock"
socket, ok := os.LookupEnv("DOCKER_HOST")
if ok {
u, err := url.Parse(socket)
if err != nil {
return nil, fmt.Errorf("failed to parse DOCKER_HOST: %w", err)
}
if u.Scheme != "unix" {
return nil, fmt.Errorf("unsupported scheme %s in DOCKER_HOST, only unix supported", u.Scheme)
}
path = u.Path
}

return &Service{
Image: "traefik:v3.1",
Expand Down Expand Up @@ -241,7 +254,7 @@ func traefik(subdomain, projectName string, port uint, dotnhostfolder string) (*
Volumes: []Volume{
{
Type: "bind",
Source: "/var/run/docker.sock",
Source: path,
Target: "/var/run/docker.sock",
ReadOnly: ptr(true),
},
Expand Down
Loading