stack

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 6, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compose

func Compose(args ...string) error

Compose runs a docker compose subcommand with output attached to the terminal.

func ComposeArgs added in v0.2.0

func ComposeArgs(args ...string) ([]string, error)

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

func ComposeOut(args ...string) (string, error)

ComposeOut runs a subcommand and captures stdout, for machine-read output.

func Dir

func Dir() (string, error)

Dir is where the stack is extracted. Generated per-project files live alongside it under caddy/sites and pgweb/bookmarks.

func Extract

func Extract() (string, error)

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)

func WriteEnv

func WriteEnv(c *registry.Config) error

WriteEnv renders stack/.env, which compose interpolates. It carries the two cluster secrets and never the per-project ones.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL