containerconfig

package
v0.4.22 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DependencyConditionStarted               = "service_started"
	DependencyConditionHealthy               = "service_healthy"
	DependencyConditionCompletedSuccessfully = "service_completed_successfully"
)

DependencyCondition constants

Variables

This section is empty.

Functions

func ParseComposeFileWithPath

func ParseComposeFileWithPath(mConfig *fly.MachineConfig, composePath string) error

ParseComposeFileWithPath parses a Docker Compose file and converts it to machine config

func ParseContainerConfig

func ParseContainerConfig(mConfig *fly.MachineConfig, composePath, machineConfigStr, configFilePath, containerName string) error

ParseContainerConfig determines the type of container configuration and parses it directly into mConfig

Types

type ComposeDependency

type ComposeDependency struct {
	Condition string `yaml:"condition"`
	Required  bool   `yaml:"required"`
	Restart   bool   `yaml:"restart"`
}

ComposeDependency represents a service dependency with conditions

type ComposeFile

type ComposeFile struct {
	Version  string                    `yaml:"version"`
	Services map[string]ComposeService `yaml:"services"`
	Volumes  map[string]any            `yaml:"volumes"`
	Networks map[string]any            `yaml:"networks"`
	Configs  map[string]any            `yaml:"configs"`
	Secrets  map[string]any            `yaml:"secrets"`
}

ComposeFile represents a Docker Compose file structure

type ComposeHealthcheck

type ComposeHealthcheck struct {
	Test        any    `yaml:"test"`
	Interval    string `yaml:"interval"`
	Timeout     string `yaml:"timeout"`
	Retries     int    `yaml:"retries"`
	StartPeriod string `yaml:"start_period"`
}

ComposeHealthcheck represents a health check configuration

type ComposeService

type ComposeService struct {
	Image       string              `yaml:"image"`
	Build       any                 `yaml:"build"`
	Environment map[string]string   `yaml:"environment"`
	Volumes     []string            `yaml:"volumes"`
	Ports       []string            `yaml:"ports"`
	Command     any                 `yaml:"command"`
	Entrypoint  any                 `yaml:"entrypoint"`
	WorkingDir  string              `yaml:"working_dir"`
	User        string              `yaml:"user"`
	Restart     string              `yaml:"restart"`
	Configs     []any               `yaml:"configs"`
	Secrets     []any               `yaml:"secrets"`
	Deploy      map[string]any      `yaml:"deploy"`
	DependsOn   any                 `yaml:"depends_on"`
	Healthcheck *ComposeHealthcheck `yaml:"healthcheck"`
	Extra       map[string]any      `yaml:",inline"`
}

ComposeService represents a service definition in Docker Compose

type ServiceDependencies

type ServiceDependencies struct {
	Dependencies map[string]ComposeDependency
}

ServiceDependencies represents parsed dependencies for a service

Jump to

Keyboard shortcuts

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