Documentation
¶
Overview ¶
Package stack materialises the embedded compose stack into DRAGONRUN_HOME and drives `docker compose` against it.
The assets are embedded rather than read from the repo so the binary works anywhere, and re-extracted on every Up so an upgraded dragonrun cannot end up driving a stale compose file.
Index ¶
- func Compose(args ...string) error
- func ComposeArgs(args ...string) ([]string, error)
- func ComposeOut(args ...string) (string, error)
- func Dir() (string, error)
- func Extract() (string, error)
- func ProjectName() string
- func RequireDocker() error
- func Running() bool
- func SetDNSMode(mode string)
- func WriteEnv(c *registry.Config) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComposeArgs ¶ added in v0.2.0
ComposeArgs returns the full `docker` argv for a compose subcommand.
It exists for callers that cannot go through Compose or ComposeOut -- provision has to pipe a script into psql's stdin, and to hand a real terminal to an interactive one -- so that the project name is still decided in exactly one place. Building the argv by hand instead silently drops the `-p`, and since the compose file carries `name: dragonrun`, every such call lands on the DEFAULT instance's containers however DRAGONRUN_HOME is set.
func ComposeOut ¶
ComposeOut runs a subcommand and captures stdout, for machine-read output.
func Dir ¶
Dir is where the stack is extracted. Generated per-project files live alongside it under caddy/sites and pgweb/bookmarks.
func Extract ¶
Extract writes the embedded assets to disk, overwriting what is there. Only the files dragonrun owns are touched -- caddy/sites and pgweb/bookmarks live outside this tree precisely so they survive.
func ProjectName ¶
func ProjectName() string
ProjectName is the docker compose project this DRAGONRUN_HOME owns.
The compose file carries `name: dragonrun`, which means every instance on the machine would share containers AND volumes regardless of DRAGONRUN_HOME. A throwaway instance pointed at a scratch home would then quietly adopt the real stack's postgres volume, and its `down -v` would destroy real data. Deriving the name from the home path makes instances genuinely independent.
func RequireDocker ¶
func RequireDocker() error
func Running ¶
func Running() bool
Running reports whether the postgres container is up, which every provisioning command needs before it can do anything useful.
func SetDNSMode ¶
func SetDNSMode(mode string)
Types ¶
This section is empty.