agentleFS
bmcszkbmcszk/agent-skills/skills/docker-compose-setup/SKILL.md

docker-compose-setup

Skill1 starsChanged 2 months agoMITView on GitHub

Docker Compose project setup for Go applications with E2E testing isolation, multi-file strategies, and optional Podman/Kubernetes/DevOps support

  • Reads credentials

The file

Show its rules and text

We split this skill into the rules it gives an agent

28 rules. About 0 are common, 28 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈28

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    ALL docker/compose commands MUST be in justfile

    line 43
  2. Distinctive:

    NEVER run raw docker compose commands

    line 44
  3. Distinctive:

    Use variables for compose file paths

    line 45
  4. Distinctive:

    ALWAYS use multi-stage builds

    line 50
  5. Distinctive:

    ALWAYS use distroless or scratch for production

    line 51
  6. Distinctive:

    ALWAYS pin Go version

    line 52
  7. Distinctive:

    ALWAYS use build caches

    line 53
  8. Distinctive:

    NEVER run as root in production

    line 54
  9. Distinctive:

    NO version field (deprecated)

    line 58
  10. Distinctive:

    ALWAYS use depends_on with condition

    line 60
  11. Distinctive:

    ALWAYS use named volumes for persistence

    line 61
  12. Distinctive:

    NEVER expose ports in production compose

    line 62
  13. Distinctive:

    ALWAYS use isolated compose file

    line 66
  14. Distinctive:

    ALWAYS use tmpfs for test databases

    line 67
  15. Distinctive:

    ALWAYS cleanup with down -v

    line 68
  16. Distinctive:

    ALWAYS use unique project names

    line 69
  17. Distinctive:

    NEVER share networks with dev

    line 70
  18. Distinctive:

    NEVER run containers as root

    line 74
  19. Distinctive:

    ALWAYS use .env files

    line 76
  20. Distinctive:

    ALWAYS scan images for vulnerabilities

    line 77
  21. Distinctive:

    ALWAYS pin image versions

    line 78
  22. Distinctive:

    NEVER run raw docker compose commands (use justfile)

    line 193
  23. Distinctive:

    NEVER use version field in compose files

    line 194
  24. Distinctive:

    NEVER run containers as root in production

    line 195
  25. Distinctive:

    NEVER hardcode secrets in compose files

    line 196
  26. Distinctive:

    NEVER share test and dev networks

    line 198
  27. Distinctive:

    NEVER forget cleanup in CI

    line 199
  28. Distinctive:

    NEVER use :latest tag in production

    line 200

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

What I do

Comprehensive Docker Compose setup for Go applications following 2026 best practices.

Core Capabilities

  1. Docker Compose Project Setup - Production-ready compose configurations
  2. E2E Testing Isolation - Dual compose file strategy for isolated test environments
  3. Multi-Stage Dockerfiles - Optimized Go application images
  4. Podman Support - Docker-compatible alternative with rootless by default
  5. Kubernetes Ready - Local development with Kind/Minikube
  6. DevOps Integration - CI/CD pipelines and infrastructure as code

References

Specialized topics are split into focused reference files:

  • Multi-Stage Dockerfile — Production & development Dockerfiles, dependency caching, distroless runtime
  • Docker Compose — Base structure, dev override, migration pattern, healthchecks
  • E2E Testing & CI/CD — Dual compose strategy, test runner, GitHub Actions, GitLab CI
  • Best Practices & IaC — Docker Compose rules, multi-file strategy, healthcheck reference
  • Podman — Compatibility, commands, quadlet systemd integration
  • Kubernetes — Kind, Minikube, Skaffold configurations

Critical Rules

Justfile (MANDATORY)

  1. ALL docker/compose commands MUST be in justfile
  2. NEVER run raw docker compose commands
  3. Use variables for compose file paths
  4. Group related commands (dev-, test-, prod-*)

Dockerfile

  1. ALWAYS use multi-stage builds
  2. ALWAYS use distroless or scratch for production
  3. ALWAYS pin Go version
  4. ALWAYS use build caches
  5. NEVER run as root in production

Docker Compose

  1. NO version field (deprecated)
  2. ALWAYS define healthchecks
  3. ALWAYS use depends_on with condition
  4. ALWAYS use named volumes for persistence
  5. NEVER expose ports in production compose

E2E Testing

  1. ALWAYS use isolated compose file
  2. ALWAYS use tmpfs for test databases
  3. ALWAYS cleanup with down -v
  4. ALWAYS use unique project names
  5. NEVER share networks with dev

Security

  1. NEVER run containers as root
  2. NEVER hardcode secrets
  3. ALWAYS use .env files
  4. ALWAYS scan images for vulnerabilities
  5. ALWAYS pin image versions

Justfile Commands (MANDATORY)

ALL docker/compose commands MUST be in justfile, never raw bash:

# justfile

# Variables
docker := "docker"
compose := docker + " compose"
compose_test := compose + " -f docker-compose.test.yml"
compose_dev := compose + " -f docker-compose.yml -f docker-compose.dev.yml"
compose_prod := compose + " -f docker-compose.yml -f docker-compose.prod.yml"
project_name := "e2e-" + env_var_or_default("BUILD_ID", "local")

# Development
default: dev-up

dev-up:
    {{ compose_dev }} up -d

dev-logs:
    {{ compose_dev }} logs -f app

dev-down:
    {{ compose_dev }} down

dev-build:
    {{ compose_dev }} build

# E2E Testing
test-e2e-up:
    {{ compose_test }} up -d --build

test-e2e-run:
    go test -v -count=1 ./test/e2e/...

test-e2e-down:
    {{ compose_test }} down -v --remove-orphans

test-e2e: test-e2e-up test-e2e-run test-e2e-down

test-e2e-ci:
    {{ compose }} -p {{ project_name }} -f docker-compose.test.yml \
        up --build --abort-on-container-exit --exit-code-from app-test

test-e2e-cleanup:
    {{ compose }} -p {{ project_name }} -f docker-compose.test.yml \
        down -v --remove-orphans

# Production
prod-up:
    {{ compose_prod }} up -d

prod-down:
    {{ compose_prod }} down

prod-build:
    {{ compose_prod }} build

# Cleanup
clean:
    {{ compose }} down -v --remove-orphans --rmi local

clean-all:
    {{ compose }} down -v --remove-orphans --rmi local
    docker system prune -f

# Podman (alternative)
podman-up:
    podman compose -f docker-compose.yml -f docker-compose.dev.yml up -d

# Kubernetes
k8s-kind-create:
    kind create cluster --config kind-config.yaml

k8s-kind-load:
    kind load docker-image myapp:latest

k8s-deploy:
    kubectl apply -f k8s/

k8s-kind-delete:
    kind delete cluster

Usage

# Development
just dev-up
just dev-logs
just dev-down

# E2E Testing
just test-e2e

# CI Pipeline
just test-e2e-ci

# Production
just prod-up

# Cleanup
just clean

Forbidden

  • NEVER run raw docker compose commands (use justfile)
  • NEVER use version field in compose files
  • NEVER run containers as root in production
  • NEVER hardcode secrets in compose files
  • NEVER skip healthchecks
  • NEVER share test and dev networks
  • NEVER forget cleanup in CI
  • NEVER use :latest tag in production

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.