agentleFS
bjw-s-labsbjw-s-labs/home-ops/.agents/skills/add-docker-app/SKILL.md

add-docker-app

Skill869 starsChanged 33 days agoApache-2.0View on GitHub

Use when deploying or changing an application on the docker hosts (gladius, icarus) — docker-compose stacks under docker/, doco-cd deployments, "deploy X to the NAS", secrets or reverse-proxy wiring for a compose app

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    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
  1. Very specific:

    Secrets: add VAR_NAME: op://<vault>/<item>/<field> under external_secrets in docker/<host>/.doco-cd.yaml, reference as ${VAR_NAME} in the …

    line 26
  2. Very specific:

    Only publish ports: directly for non-HTTP protocols (see towonel: 22, 51820/udp).

    line 31

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

Add an App to a Docker Host

Apps live in docker/<host>/NN-<app>/docker-compose.yaml, deployed GitOps-style by doco-cd (config: docker/<host>/.doco-cd.yaml): it polls this repo's main hourly, auto-discovers stacks one directory deep, and delete: true means removing (or renaming) a directory deletes the running stack. Mirror an existing app rather than inventing structure:

HostProxyNetworkReference apps
gladius (TrueNAS)traefik (02-traefik, docker provider with exposedByDefault: false plus an inline file provider, wildcard *.bjw-s.dev)apps, or network_mode: host05-zot (labels, config, bind-mount storage), 03-exporters (host network)
icaruscaddy-l4 (03-caddy-l4, Caddyfile)external edge (no published ports for HTTP)04-gatus (config file, secrets), 02-towonel (published non-HTTP ports)

Steps

  1. Directory: next free NN- prefix on that host (ls docker/<host>/). The number is just ordering; keep it stable — renaming triggers delete+recreate.
  2. Compose file — conventions from existing apps:
    • Top-level name: <app> and container_name: <app>, restart: unless-stopped.
    • Registry-qualified image with a pinned version tag. Never write a tag from memory — look up the upstream project's current release first. Plain tags are fine; Renovate manages digests/updates. Keep a # renovate: datasource=docker depName=... hint comment only if copying from an app that has one (e.g. 01-crowdsec, 02-towonel).
    • Set user: where the image supports it (see towonel).
    • Config files: config/ subdirectory, wired via a configs: block (04-gatus, 05-zot) or a read-only bind volume.
    • Persistent data: on gladius, named volume with driver_opts bind to /mnt/tank/apps/<app>/<vol> (see zot); on icarus, host path (towonel uses /opt/<app>) or a named volume.
  3. Secrets: add VAR_NAME: op://<vault>/<item>/<field> under external_secrets in docker/<host>/.doco-cd.yaml, reference as ${VAR_NAME} in the compose file. Use the item's real field names (ask the user; never guess) — doco-cd injects these as env vars at deploy time.
  4. Expose it (only if it serves HTTP):
    • icarus: join the edge network (networks: default: {name: edge, external: true}), publish no HTTP ports, then register icarus-<app>.bjw-s.dev in two places: VPS_LOCAL_HOSTS in 03-caddy-l4/docker-compose.yaml AND a reverse_proxy <container>:<port> site block in 03-caddy-l4/config/Caddyfile.
    • gladius: join the apps network and add labels like 05-zot: traefik.enable, a Host() router rule, the service port, and dexd.enabled: 'true' so dexd creates the DNS record pointing at traefik. To expose a service that runs on the host rather than in a container (such as the TrueNAS S3 service behind s3.bjw-s.dev), add a file-provider service to 02-traefik and put the router labels on the traefik container itself.
    • Only publish ports: directly for non-HTTP protocols (see towonel: 22, 51820/udp).
  5. Verify: docker compose -f docker/<host>/NN-<app>/docker-compose.yaml config --quiet (unset ${VAR} warnings are expected). Show the user the files before committing. Commit style: feat(<app>): Deploy to NAS.

Common mistakes

  • Inventing an image tag — check the upstream release; a hallucinated tag deploys nothing or the wrong thing.
  • Secret in compose but not in .doco-cd.yaml — the ${VAR} silently resolves empty.
  • Publishing HTTP ports on icarus — everything HTTP goes through caddy-l4 over edge; published ports bypass TLS and auth.
  • Registering the hostname in only one of Caddyfile / VPS_LOCAL_HOSTS — both are required.
  • Renaming/renumbering an existing app directory casually — delete: true tears the old stack down, losing anonymous volumes.

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.