Skip to content

Add a Docker Compose file for Coolify deployments - #1328

Merged
helpcodeai merged 8 commits into
HelpCode-ai:mainfrom
flyingwebie:feat/coolify-compose
Nov 3, 2026
Merged

helpcodeai merged 8 commits into
HelpCode-ai:mainfrom
flyingwebie:feat/coolify-compose

Conversation

@flyingwebie

@flyingwebie flyingwebie commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Deploying AnythingMCP on Coolify v4 needed a hand-edited compose file. The default compose publishes host ports and needs every secret entered by hand. If you point the app URLs at Coolify's domain variable for port 3000, the OAuth metadata advertises https://<domain>:3000/..., which nobody outside can reach. MCP clients such as Claude.ai then can't finish the OAuth redirect.

docker-compose.coolify.yml is built for a Coolify "Docker Compose" resource.

Changes

  • New docker-compose.coolify.yml, with app (the published image) and postgres:
    • One domain routed to port 3000 via SERVICE_URL_APP_3000. Next.js already proxies /api, /mcp, /.well-known, OAuth and SSO to the backend.
    • FRONTEND_URL, SERVER_URL and CORS_ORIGIN are set to ${PUBLIC_URL:-${SERVICE_URL_APP}}, i.e. the domain without the port. PUBLIC_URL is an optional override.
    • Coolify generates the database credentials, JWT_SECRET, COOKIE_SECRET and ENCRYPTION_KEY (SERVICE_PASSWORD_* / SERVICE_HEX_*).
    • SMTP_HOST, SMTP_USER, SMTP_PASS and SMTP_FROM are required (${VAR:?}), so Coolify won't deploy until they're set. SMTP_PORT defaults to 587.
    • MCP_API_KEY and MCP_BEARER_TOKEN default to empty. The comments explain that they are instance-wide master credentials that skip the workspace check.
    • There are no host ports and no container_name, so several instances can share a server.
  • docs/deployment.md: new "Coolify" section.
  • llms-full.txt: regenerated.

Type

  • Bug fix
  • New feature
  • Documentation
  • Refactoring
  • Performance improvement
  • Other (describe below)

Testing

  • Added/updated unit tests
  • Tested manually (describe steps below)
  • No tests needed (explain why)

Commands, from the repository root:

  • docker compose -f docker-compose.coolify.yml config with SERVICE_URL_APP_3000=https://sec-mcp.flyingweb.ie:3000, SERVICE_URL_APP=https://sec-mcp.flyingweb.ie and the SMTP variables set: SERVER_URL, FRONTEND_URL and CORS_ORIGIN resolve to https://sec-mcp.flyingweb.ie, without the port.
  • The same with PUBLIC_URL=https://other.example: all three resolve to the override.
  • The same with one SMTP variable unset: config fails with a required-variable error, as intended.
  • node scripts/generate-llms-txt.mjs --check: passes.

Follow-up validation on head fc0d56feba525cc717b4993b7cf40f5f2b3564e5:

  • Root: npm ci — passed.
  • Root: docker compose --env-file /dev/null -f docker-compose.coolify.yml config --format json, using synthetic Coolify and SMTP values — passed assertions for the default URL and PUBLIC_URL override, no published host ports or container names, empty master credentials, and anonymous access disabled. Each of the four required SMTP variables was tested both unset and empty; all eight cases correctly failed.
  • Root: node scripts/validate-adapters.mjs --warn — 576 passed, 0 failed, 1,442 existing warnings. This PR changes no adapters.
  • Root: node scripts/generate-llms-txt.mjs then node scripts/generate-llms-txt.mjs --check — passed, with no generated diff.
  • packages/backend: DATABASE_URL=postgresql://localhost:5433/anythingmcp npx prisma generate — passed; the URL was used only for client generation, with no database connection.
  • packages/backend: npm test -- --runInBand catalog.spec.ts catalog-summary.spec.ts catalog-search.spec.ts catalog-url-match.spec.ts — 5 suites passed, 10,678 tests passed (the pattern also selects the Meta catalog static suite).
  • GitHub checks on this head: backend, frontend, frontend e2e, CLI, Docker build and security checks pass. The CLA check remains failed.

Not yet verified: a full redeploy on a live Coolify server with the SERVICE_URL_APP default. The earlier version, with an explicit PUBLIC_URL, worked there.

The linked review requests no code changes. Its sole merge blocker is the contributor's CLA signature; the contributor must complete that personally.

Cloud vs self-hosted: this only adds a self-hosted deployment option. Cloud is unaffected.

Checklist

  • My code follows the existing code style
  • I have tested my changes locally
  • I have updated documentation (if applicable)
  • Existing backend and frontend checks pass in GitHub CI; local catalog tests pass as detailed above.
  • This PR has a descriptive title

Related Issues

None.

🤖 Generated with Claude Code

Coolify generates the database password and app secrets, routes one
domain to port 3000, and blocks the deploy until SMTP is filled in.
The public URL comes from SERVICE_URL_APP, without the :3000 suffix,
so the OAuth metadata MCP clients redirect through stays reachable.
PUBLIC_URL overrides it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown

👋 Welcome, @flyingwebie, and thanks for opening your first PR on AnythingMCP!

A few quick pointers:

  • Make sure CI is green before requesting review (Backend, Frontend, Playwright, CodeQL, Trivy).
  • If this is a new adapter, the parametrised catalog.spec.ts test will validate it automatically.
  • Sign off your commits if you can — it's not blocking, just nice to have.

Someone from the core team will look at this within ~48h. If you don't hear back, please ping us in Discussions / Q&A.

⭐ While you wait — if you find AnythingMCP useful, a star helps others discover it.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@helpcodeai helpcodeai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @flyingwebie, this is a clean file. I went through it for security and it looks right to me:

  • No host ports are published and Postgres stays on the internal network.
  • JWT_SECRET, COOKIE_SECRET, ENCRYPTION_KEY and the database password come from Coolify's generated values, so nothing weak is shipped as a default.
  • MCP_API_KEY and MCP_BEARER_TOKEN default to empty, MCP_ALLOW_ANONYMOUS=false and registration is invite-only. Good.
  • The public URL is the one without :3000, which is what the OAuth metadata needs.

One thing blocks the merge: the CLA check is still red. Please post this exact comment in the PR, and the bot will turn the check green:

I have read the CLA Document and I hereby sign the CLA

I have approved the CI runs for your branch. Once the CLA is signed and CI is green, I will merge it.

@helpcodeai

Copy link
Copy Markdown
Contributor

@flyingwebie friendly nudge: everything else here is green. The only thing left is the CLA. Post this exact comment in this PR:

I have read the CLA Document and I hereby sign the CLA

and I'll merge it.

@flyingwebie

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Nov 3, 2026
@helpcodeai
helpcodeai merged commit edfca08 into HelpCode-ai:main Nov 3, 2026
14 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants