Repository navigation
Add a Docker Compose file for Coolify deployments - #1328
Conversation
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]>
|
👋 Welcome, @flyingwebie, and thanks for opening your first PR on AnythingMCP! A few quick pointers:
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. |
|
All contributors have signed the CLA ✍️ ✅ |
helpcodeai
left a comment
There was a problem hiding this comment.
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_KEYand the database password come from Coolify's generated values, so nothing weak is shipped as a default.MCP_API_KEYandMCP_BEARER_TOKENdefault to empty,MCP_ALLOW_ANONYMOUS=falseand 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.
|
@flyingwebie friendly nudge: everything else here is green. The only thing left is the CLA. Post this exact comment in this PR:
and I'll merge it. |
|
I have read the CLA Document and I hereby sign the CLA |
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.ymlis built for a Coolify "Docker Compose" resource.Changes
docker-compose.coolify.yml, withapp(the published image) andpostgres:SERVICE_URL_APP_3000. Next.js already proxies/api,/mcp,/.well-known, OAuth and SSO to the backend.FRONTEND_URL,SERVER_URLandCORS_ORIGINare set to${PUBLIC_URL:-${SERVICE_URL_APP}}, i.e. the domain without the port.PUBLIC_URLis an optional override.JWT_SECRET,COOKIE_SECRETandENCRYPTION_KEY(SERVICE_PASSWORD_*/SERVICE_HEX_*).SMTP_HOST,SMTP_USER,SMTP_PASSandSMTP_FROMare required (${VAR:?}), so Coolify won't deploy until they're set.SMTP_PORTdefaults to 587.MCP_API_KEYandMCP_BEARER_TOKENdefault to empty. The comments explain that they are instance-wide master credentials that skip the workspace check.container_name, so several instances can share a server.docs/deployment.md: new "Coolify" section.llms-full.txt: regenerated.Type
Testing
Commands, from the repository root:
docker compose -f docker-compose.coolify.yml configwithSERVICE_URL_APP_3000=https://sec-mcp.flyingweb.ie:3000,SERVICE_URL_APP=https://sec-mcp.flyingweb.ieand the SMTP variables set:SERVER_URL,FRONTEND_URLandCORS_ORIGINresolve tohttps://sec-mcp.flyingweb.ie, without the port.PUBLIC_URL=https://other.example: all three resolve to the override.configfails with a required-variable error, as intended.node scripts/generate-llms-txt.mjs --check: passes.Follow-up validation on head
fc0d56feba525cc717b4993b7cf40f5f2b3564e5:npm ci— passed.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 andPUBLIC_URLoverride, 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.node scripts/validate-adapters.mjs --warn— 576 passed, 0 failed, 1,442 existing warnings. This PR changes no adapters.node scripts/generate-llms-txt.mjsthennode 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).Not yet verified: a full redeploy on a live Coolify server with the
SERVICE_URL_APPdefault. The earlier version, with an explicitPUBLIC_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
Related Issues
None.
🤖 Generated with Claude Code