Documentation
¶
Overview ¶
Package project detects the kind of Docker project in a directory, loads the optional soloenv.yml config, and resolves which local port to expose.
Index ¶
- func DockerfileExpose(dir, dockerfile string) int
- func ResolveAuth(cfg *Config, flagPassword string, flagProtect bool) (user, password string, err error)
- func ResolveComposePort(dir, composeFile, service string, override int) (int, error)
- func ResolveEnvFile(dir string, cfg *Config, flagPath string) (string, error)
- func ResolveTTL(cfg *Config, flagTTL string) (time.Duration, error)
- type Config
- type Kind
- type Project
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DockerfileExpose ¶
DockerfileExpose reads the first EXPOSE port from the Dockerfile, or 0 if none.
func ResolveAuth ¶
func ResolveAuth(cfg *Config, flagPassword string, flagProtect bool) (user, password string, err error)
ResolveAuth returns user and password for basic auth. Empty password means no auth.
func ResolveComposePort ¶
ResolveComposePort determines the host port to expose for a compose project. override (from flag/config) wins if > 0. Otherwise it parses the rendered compose config: if service is given, its first published port is used; if not, and exactly one published port exists across services, that one is used.
func ResolveEnvFile ¶
ResolveEnvFile picks the env file for docker compose/run. Priority: flag > config > .env.staging > .env.soloenv
Types ¶
type Config ¶
type Config struct {
Port int `yaml:"port"`
Service string `yaml:"service"`
Build *bool `yaml:"build"`
EnvFile string `yaml:"env_file"`
Password string `yaml:"password"`
AuthUser string `yaml:"auth_user"`
TTL string `yaml:"ttl"`
}
Config is the optional soloenv.yml file in the project directory.
func LoadConfig ¶
LoadConfig reads soloenv.yml/soloenv.yaml from dir if present. A missing file is not an error: it returns an empty config.