Documentation
¶
Overview ¶
Package compose provides Docker Compose to Nexlayer Deployment YAML conversion functionality.
Index ¶
- Variables
- func DetectAndConvert(projectDir string) (*yaml.NexlayerYAML, error)
- func ParsePortMapping(portStr, serviceName string) (int, int, string, error)
- func ParseVolumeMapping(volumeStr, serviceName string) (string, string, bool, error)
- type ConvertOptions
- type DockerComposeConfig
- type DockerComposeService
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultPorts = map[string]int{
"postgres": 5432,
"mysql": 3306,
"redis": 6379,
"nginx": 80,
"apache": 80,
"node": 3000,
"mongo": 27017,
"clickhouse": 8123,
"minio": 9000,
}
DefaultPorts maps common images to their default ports
View Source
var DefaultVolumeSizes = map[string]string{
"postgres": "10Gi",
"mysql": "10Gi",
"mongo": "10Gi",
"clickhouse": "10Gi",
"minio": "10Gi",
"default": "1Gi",
}
DefaultVolumeSizes maps service types to default volume sizes
Functions ¶
func DetectAndConvert ¶
func DetectAndConvert(projectDir string) (*yaml.NexlayerYAML, error)
DetectAndConvert looks for docker-compose files and converts them to Nexlayer Deployment YAML
func ParsePortMapping ¶
ParsePortMapping parses a Docker port mapping string like "8080:80/tcp"
Types ¶
type ConvertOptions ¶
type ConvertOptions struct {
ProjectDir string
ApplicationName string
ForceConversion bool
ComposeFileName string
}
ConvertOptions provides configuration options for the conversion process
type DockerComposeConfig ¶
type DockerComposeConfig struct {
Version string `yaml:"version,omitempty"`
Services map[string]DockerComposeService `yaml:"services"`
Volumes map[string]interface{} `yaml:"volumes,omitempty"`
ConfigPath string
}
DockerComposeConfig represents the structure of a docker-compose.yml file
type DockerComposeService ¶
type DockerComposeService struct {
Image string `yaml:"image"`
Build interface{} `yaml:"build,omitempty"`
Environment interface{} `yaml:"environment,omitempty"`
EnvFile interface{} `yaml:"env_file,omitempty"`
Ports interface{} `yaml:"ports,omitempty"`
Volumes interface{} `yaml:"volumes,omitempty"`
}
DockerComposeService represents a service in docker-compose.yml
Click to show internal directories.
Click to hide internal directories.