Description
Docker Compose support lets Testcontainers for Go run a stack defined by a Compose file directly through the Compose v2 API.Examples
Dependency:
go get github.com/testcontainers/testcontainers-go/modules/compose
Usage:
stack, err := compose.NewDockerComposeWith(
compose.WithStackFiles("docker-compose.yml"),
)
if err != nil {
return err
}
defer stack.Down(context.Background())
err = stack.Up(context.Background())