agentleFS
NikoxkxNikoxkx/Agent-Skills/skills/devops/docker-compose-generator/SKILL.md

docker-compose-generator

Skill1 starsChanged 5 months agoApache-2.0View on GitHub

Generates production-ready docker-compose.yml files for multi-service applications. Use when containerizing an app with databases, caches, or other services.

  • Reads credentials

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Distinctive:

    Use Docker secrets or external secret managers for prod.

    line 50
  2. Distinctive:

    Never put real credentials in the committed compose file.

    line 52
  3. Very specific:

    Database initialization: Use depends_on + healthcheck, and an init container or entrypoint script that waits for DB.

    line 75
  4. Distinctive:

    Permission issues with volumes: Run containers as non-root user.

    line 76
  5. Very specific:

    Secrets in CI: Use GitHub Secrets or similar + docker compose with --env-file from secrets.

    line 77

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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

Overview

Generates secure, production-oriented docker-compose.yml (and docker-compose.override.yml for local dev) with proper service definitions, networks, volumes, healthchecks, resource limits, environment variable management, secrets handling, and restart policies. Includes full examples for common stacks (Node.js + Postgres + Redis, Python + Postgres + Redis, etc.).

When to Use This Skill

  • Containerizing a new or existing multi-service application.
  • The user says "docker-compose", "containerize", "local dev environment with DB", or "production docker setup".
  • Setting up consistent environments across developer machines and CI/CD.

Prerequisites

  • Docker Desktop or Docker Engine + Compose V2 installed.
  • Application code that can be containerized (Dockerfile exists or can be created).
  • Understanding of the services needed (database, cache, queue, etc.).

Steps

  1. Inventory all services the app needs (app, db, cache, queue, search, etc.).
  2. Define networks:
    • frontend (for reverse proxy / app).
    • backend (internal, for app ↔ db, app ↔ cache).
  3. Define volumes for persistent data (named volumes preferred over bind mounts in production).
  4. Service definition template (for each service):
    • image or build.
    • environment or env_file (never commit secrets in prod compose).
    • volumes.
    • networks.
    • healthcheck (critical).
    • restart: unless-stopped.
    • deploy.resources limits/requests (for Swarm or when using compose with limits).
    • depends_on with condition: service_healthy.
  5. Secrets & config:
    • Use Docker secrets or external secret managers for prod.
    • For local: .env loaded via env_file.
    • Never put real credentials in the committed compose file.
  6. Healthchecks:
    • DB: pg_isready, mysqladmin ping, etc.
    • App: /health endpoint that checks DB connectivity.
  7. Local vs prod:
    • docker-compose.yml for prod-like.
    • docker-compose.override.yml (auto-loaded) for local dev (hot reload, different ports, debug flags).
  8. Output:
    • Full docker-compose.yml.
    • Example Dockerfile for the app if missing.
    • .env.example.
    • Commands to bring up, view logs, run migrations, etc.
    • Production notes (use docker compose up -d, logging drivers, etc.).

Examples

Complete docker-compose.yml for a Node.js + PostgreSQL + Redis + optional Nginx reverse proxy stack, with healthchecks, named volumes, proper networking, and a matching override for local development is included, along with the corresponding Dockerfiles and .env.example.

Edge Cases & Error Handling

  • Database initialization: Use depends_on + healthcheck, and an init container or entrypoint script that waits for DB.
  • Permission issues with volumes: Run containers as non-root user; set correct UID/GID on volumes.
  • Secrets in CI: Use GitHub Secrets or similar + docker compose with --env-file from secrets.
  • Scaling: Note that some services (Postgres) are not easily horizontally scaled in compose; recommend managed DB for prod.

Verification

  1. docker compose config — validates syntax.
  2. docker compose up --build -d — all services healthy (check docker compose ps).
  3. App can connect to DB and Redis (test endpoints).
  4. docker compose down -v cleans up.
  5. Success: Environment is reproducible, services start reliably, data persists across restarts, and no secrets are in the repo.

References

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.