testcontainers-go

GitHub

Testcontainers for Go is a Go package that makes it simple to create and clean up container-based dependencies for automated integration/smoke tests. The clean, easy-to-use API enables developers to programmatically define containers that should be run as part of a test and clean up those resources when the test is done.

RAW Compose
1. Pull Image docker pull testcontainers/testcontainers-go:latest
2. 1-Click Launch Command docker run -d --name testcontainers-go --restart always testcontainers/testcontainers-go:latest
3. Compose Deployment docker compose up -d
modules/compose/testdata/docker-compose-build.yml
Download .yml
services:
  {{ .ServiceType }}-echo:
    build:
      dockerfile: echoserver.Dockerfile
    environment:
      FOO: "Hello, World!"
    ports:
      - target: 8080
        published: {{ .Port_0 }}
        protocol: tcp