compose

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package compose wraps the docker-compose CLI for devrig managed services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiscoverServices

func DiscoverServices(composePath string) []string

DiscoverServices reads a docker-compose.yml and returns the service names defined under the top-level `services:` key — without running Docker.

func Down

func Down(composeFile, projectName string) error

Down runs `docker compose down --remove-orphans`.

func Up

func Up(composeFile, projectName string, services []string, envFile string) error

Up runs `docker compose up -d` for the named services.

Types

type Publisher

type Publisher struct {
	TargetPort    uint16 `json:"TargetPort"`
	PublishedPort uint16 `json:"PublishedPort"`
}

Publisher is a port binding reported by docker compose ps.

type Service

type Service struct {
	ID         string      `json:"ID"`
	Name       string      `json:"Name"`
	Service    string      `json:"Service"`
	State      string      `json:"State"`
	Health     string      `json:"Health"`
	Publishers []Publisher `json:"Publishers"`
}

Service represents a running compose service from `docker compose ps --format json`.

func PS

func PS(composeFile, projectName string) ([]Service, error)

PS runs `docker compose ps --format json` and parses the output.

Jump to

Keyboard shortcuts

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