docker-single-port-multi-instance

docker-single-port-multi-instance is a skill for Claude Code, Codex from pedroiff0/awesome-skills. It costs 73 tokens per session (1,849 once invoked), scanned A, original, MIT.

A deployment pattern for serving several separate Docker Compose application instances through one host port using an nginx reverse proxy. A reverse proxy routes incoming web requests to the right application.

In plain words
What is it for?
Use it to route the main application and a database-isolated demo by URL paths such as /demo, with each instance remaining in its own container.
Why use it?
It avoids merging separate production, test, and demo applications or databases into one process while keeping them available at the same time.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to route the main application and a database-isolated demo by URL paths such as /demo, with each instance remaining in its own container.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/pedroiff0/awesome-skills/docker-single-port-multi-instance
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add pedroiff0/awesome-skills --skill docker-single-port-multi-instance
Clone the repo
git clone --depth 1 https://github.com/pedroiff0/awesome-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for docker-single-port-multi-instance

README.md
[![agentmods](https://agentmods.dev/badge/skills/pedroiff0/awesome-skills/docker-single-port-multi-instance/github.svg)](https://agentmods.dev/skills/pedroiff0/awesome-skills/docker-single-port-multi-instance)
Your own site
<a href="https://agentmods.dev/skills/pedroiff0/awesome-skills/docker-single-port-multi-instance"><img src="https://agentmods.dev/badge/skills/pedroiff0/awesome-skills/docker-single-port-multi-instance/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for docker-single-port-multi-instance

Your own site · 80×15
<a href="https://agentmods.dev/skills/pedroiff0/awesome-skills/docker-single-port-multi-instance"><img src="https://agentmods.dev/badge/skills/pedroiff0/awesome-skills/docker-single-port-multi-instance.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,849 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00073 $0.01849
Opus 5 $0.00036 $0.00924
Sonnet 5 $0.00015 $0.00370
Haiku 4.5 $0.00007 $0.00185

Measured 8d ago against content hash c07565c7c5a3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

docker-single-port-multi-instance scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

Verify with `curl -s -D - -o /dev/null URL/demo | grep -i location` — it must
skills/devops/docker-single-port-multi-instance/SKILL.md · 134 lines

How it starts

The opening of the file, as written. The whole thing — 134 lines — stays where its author put it; the contents beside it link to each section on GitHub.

One port, many instances: nginx reverse proxy by path prefix

When this applies

  • You have an app that runs as several instances: production, test, and a public demo — each with its OWN database.
  • The user asks for a single published port (e.g. 4460) where the demo is reached by clicking a button on the landing page, and the demo's data lives in its own DB, isolated from prod/test.
  • Key constraint: the demo must be reachable SIMULTANEOUSLY with the main app.

Prefer nginx-by-prefix over in-app multi-tenancy

When the ONLY goal is routing separate instances, do NOT refactor the app to hold two DB connections (e.g. a second mongoose connection) just to serve /demo/* from the same process. That touches ~30 files (every model + service + controller) and risks regressing the normal routes. Instead:

  • Keep each instance as its own container (own DB, own env).
  • Put ONE nginx container on the public port; it routes:
    • /demo/*app-demo (strip prefix: proxy_pass http://app-demo:5000/;)
    • / (rest) → app (the principal: test or prod chosen via .env)
  • The demo container keeps its existing autologin; the button on the landing just points to /demo/app.

This delivers "one port, demo with own DB, simultaneous" with near-zero risk to the main app's logic.

The non-obvious gotcha: APIs must also be prefixed

If the demo is served under /demo/* but its client JS calls /api/... (absolute), the proxy sends those calls to the PRINCIPAL instance, not the demo → tokens fail (401 "Token invalido"). You must route the demo's APIs to the demo instance too:

  1. Mount the demo's API router under /demo/api in the app (only when a DEMO_AUTOLOGIN-style flag is set), in addition to the normal /api.
  2. Make the frontend prefix API calls with /demo when running in the demo. Inject the prefix WITHOUT an inline script (CSP will block it — see the express-csp-runtime-config skill): use data-api-prefix="/demo" on <html> and read it with getAttribute inside the shared fetch wrapper.

Read the full file on GitHub · 134 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 134 lines · 73 tokens per session scan A c07565c7c5a3

Subscribe to this mod's changes

docker-single-port-multi-instance is a skill published in the GitHub repository pedroiff0/awesome-skills (1 stars, last pushed yesterday), licensed MIT. It adds 73 tokens to every session and 1,849 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories