windymelt

Docker Compose worktree port assigner: randomize port to avoid collision between worktree

11
0
100% credibility
Found Mar 19, 2026 at 11 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Scala
AI Summary

A utility that assigns consistent, unique network port numbers to services in different project folders, preventing conflicts when running multiple instances at once.

How It Works

1
😩 Project Clashes

You're running multiple copies of your project from different folders, but their background services fight over the same network spots and can't work together.

2
🔍 Discover Comport

You find this clever little tool that smartly picks unique, always-the-same network spots for each project folder so they never clash.

3
📥 Grab the Tool

Download the ready-made program that matches your computer, make it easy to run from anywhere.

4
🚀 Run in Your Folder

Step into one of your project folders and launch the tool – it instantly figures out perfect unique spots for all your services based on where the folder is.

5
🔌 Use the Spots

Copy the special numbers it gives you into your project setup, so each service knows its own spot.

6
⚙️ Launch Everything

Start up services in all your project folders at the same time – they all connect smoothly without any bumps.

🎉 Multiple Projects Live

Now you can work on different versions of your project side-by-side, everything runs perfectly together every time.

Sign up to see the full architecture

5 more

Sign Up Free

Star Growth

See how this repo grew from 11 to 11 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is comport?

Comport is a Scala CLI tool that assigns deterministic ports to Docker Compose services across git worktrees, preventing collisions when running multiple branches simultaneously. Drop into a repo, run `eval "$(comport)"`, and it auto-detects services from your docker compose file or docker-compose.yml, mapping them to a stable range like 10000-59999 based on the worktree path. Eval the output before `docker compose up` to host web, db, or whatever without port fights—think comportment for your docker compose ports.

Why is it gaining traction?

Unlike manual port tweaks or random allocators, comport delivers the same ports every time for a given worktree, making docker compose restart and docker compose down reliable across sessions. It overrides with `--names` for custom setups, outputs .env files for docker compose volumes and networks, or hooks into direnv for auto-exports. Devs dig the zero-config auto-detection and cross-platform binaries, sidestepping chaos in docker github actions or local multitasking.

Who should use this?

Backend engineers juggling git worktrees for feature branches with docker compose build pipelines. Teams hitting port clashes during parallel `docker compose up` on services like APIs and caches. Direnv users wanting seamless env vars for docker compose yml in multi-branch workflows.

Verdict

At 11 stars and 1.0% credibility, comport is immature but punches above with crisp docs, native binaries, and no-frills Scala reliability. Try it for docker compose ports pain—solid for worktree warriors, skip if you're not deep in Compose.

(178 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.