Documentation
¶
Overview ¶
Package compose turns a docker compose file into what Jokku runs: one app whose process types are the file's services, each with its own image.
The file is read with compose-go, the loader docker compose itself uses, so interpolation (${VAR}, with the app's config vars and the repo's .env), profiles (COMPOSE_PROFILES), extends within the file and the many short and long syntaxes behave as in Docker. What Jokku cannot run (host networking, privileged containers, secrets, host paths) is refused with a message rather than half emulated.
Every path the file names must stay inside the pushed source: the deploy runs as root on the control node and must never read anything else.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultFiles = []string{"compose.yaml", "compose.yml", "docker-compose.yaml", "docker-compose.yml"}
DefaultFiles are looked for, in order, when no compose file is set.
Functions ¶
This section is empty.
Types ¶
type Copy ¶
Copy is a file or directory of the source (Src, relative to the root) baked into the image at Dst.
type Mount ¶
type Mount struct {
Volume string // Jokku volume name
Path string
// External volumes must already exist; others are created on deploy.
External bool
}
Mount puts a Jokku volume at Path.
type Plan ¶
type Plan struct {
File string // the compose file, relative to the source root
Services map[string]*Service
// Web is the service that gets HTTP traffic: the one named web, or the
// only one publishing ports. "" when none does.
Web string
// Notes are things in the file Jokku ignores, for the deploy log.
Notes []string
}
Plan is a compose file, translated.
type Service ¶
type Service struct {
Name string
// Image is pulled when Context is empty; otherwise Dockerfile (or
// Inline) is built in Context with Args, up to Stage.
Image string
Context string // absolute
Dockerfile string // absolute
Inline string
Args map[string]string
Stage string
Copies []Copy // files of the source baked into an Image, from bind mounts
Entrypoint []string // nil: the image's
Command []string // nil: the image's
Env []string // KEY=value, sorted
User string
WorkingDir string
Port int // 0: the image's EXPOSE, if any
Published bool
Replicas int
CPUs int // 0: Jokku's default
MemoryMB int // 0: Jokku's default
Restart string
StopSecs int
StopSignal string
DependsOn []string
NoCheck bool // healthcheck disabled
Mounts []Mount
}
Service is one service, as a Jokku process type.