wisski-cloud-distillery/internal/wisski/ingredient/barrel/stack.go
Tom Wiesing e969351f8e
config/network: Prepare for multiple networks
This commit futures proofs the code to allow for usage of more than one
docker network.
2023-03-13 10:11:28 +01:00

37 lines
933 B
Go

package barrel
import (
"embed"
"path/filepath"
"github.com/FAU-CDI/wisski-distillery/internal/dis/component"
)
//go:embed all:barrel barrel.env
var barrelResources embed.FS
// Barrel returns a stack representing the running WissKI Instance
func (barrel *Barrel) Stack() component.StackWithResources {
return component.StackWithResources{
Stack: component.Stack{
Dir: barrel.FilesystemBase,
},
Resources: barrelResources,
ContextPath: filepath.Join("barrel"),
EnvPath: filepath.Join("barrel.env"),
EnvContext: map[string]string{
"DOCKER_NETWORK_NAME": barrel.Malt.Config.Docker.Network(),
"SLUG": barrel.Slug,
"VIRTUAL_HOST": barrel.Domain(),
"HTTPS_ENABLED": barrel.Malt.Config.HTTP.HTTPSEnabledEnv(),
"DATA_PATH": filepath.Join(barrel.FilesystemBase, "data"),
"RUNTIME_DIR": barrel.Malt.Config.Paths.RuntimeDir(),
},
MakeDirs: []string{"data", ".composer"},
}
}