Skip to content

fix(coolify): use environment map syntax for Coolify v4 parser#424

Open
healdigital wants to merge 1 commit into
rohitg00:mainfrom
healdigital:fix/coolify-v4-env-syntax
Open

fix(coolify): use environment map syntax for Coolify v4 parser#424
healdigital wants to merge 1 commit into
rohitg00:mainfrom
healdigital:fix/coolify-v4-env-syntax

Conversation

@healdigital
Copy link
Copy Markdown

@healdigital healdigital commented May 16, 2026

Summary

Coolify v4's PHP-based docker-compose validator rejects the shorthand environment list syntax (- VAR without =) in deploy/coolify/docker-compose.yml, breaking the official one-click deploy flow.

The exact build error is:

Error: non-string key in services.agentmemory.environment: 0
exit status 1

This happens because Coolify's parser converts the YAML list into a PHP array with numeric indices (0 => "SERVICE_FQDN_AGENTMEMORY_3111"), then fails its "all environment keys must be strings" assertion.

Fix

Switch to the equivalent map form with explicit ${VAR} substitution:

     environment:
-      - SERVICE_FQDN_AGENTMEMORY_3111
+      SERVICE_FQDN_AGENTMEMORY_3111: ${SERVICE_FQDN_AGENTMEMORY_3111}

This preserves the original "inherit from build env" semantics — Coolify still resolves SERVICE_FQDN_AGENTMEMORY_3111 through its magic-variable mechanism — while satisfying the stricter parser.

Verification

Locally with Docker Compose v2:

SERVICE_FQDN_AGENTMEMORY_3111=https://example.com \
  docker compose -f deploy/coolify/docker-compose.yml \
                 --project-directory deploy/coolify config

Output shows SERVICE_FQDN_AGENTMEMORY_3111: https://example.com correctly substituted.

End-to-end test on a Coolify v4.0.0-beta.397 instance:

  • Before this patch: deploy fails at compose validation step.
  • After this patch: deploy succeeds, container reaches running:healthy on first try, /agentmemory/livez returns {"service":"agentmemory","status":"ok"} over HTTPS via Traefik.

Notes

  • No behaviour change on the runtime side — only a syntactic adjustment to be parser-friendly across Coolify versions.
  • The shorthand list form remains valid in upstream Docker Compose, so this doesn't break any local-dev scenario.

Test plan

  • docker compose -f deploy/coolify/docker-compose.yml --project-directory deploy/coolify config resolves with SERVICE_FQDN_AGENTMEMORY_3111 set
  • Coolify v4 one-click deploy flow completes without "non-string key" error
  • Container starts healthy on a fresh deploy

Summary by CodeRabbit

  • Chores
    • Updated deployment configuration for environment variable handling.

Review Change Stack

Coolify v4's PHP-based docker-compose validator rejects the shorthand
environment list syntax ('- VAR' without =) with:

    Error: non-string key in services.agentmemory.environment: 0

Switching to the map form with explicit variable substitution preserves
the original 'inherit from build env' behavior — Coolify still resolves
SERVICE_FQDN_AGENTMEMORY_3111 from the magic variable mechanism — while
satisfying the stricter parser.

Verified with:
  SERVICE_FQDN_AGENTMEMORY_3111=https://example.com \
    docker compose -f deploy/coolify/docker-compose.yml \
                   --project-directory deploy/coolify config

Tested live on a Coolify v4.0.0-beta.397 instance: deploy succeeds and
container reaches running:healthy on first try with this change.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

@healdigital is attempting to deploy a commit to the rohitg00's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: da5ae9c7-38b4-402d-871b-80c5e30598ee

📥 Commits

Reviewing files that changed from the base of the PR and between b7e1240 and 4396ca9.

📒 Files selected for processing (1)
  • deploy/coolify/docker-compose.yml

📝 Walkthrough

Walkthrough

The SERVICE_FQDN_AGENTMEMORY_3111 environment variable in the Docker Compose configuration is converted from YAML list-item syntax to the proper key/value mapping format for correct Docker Compose parsing.

Changes

Docker Compose Configuration Syntax

Layer / File(s) Summary
Environment variable YAML syntax fix
deploy/coolify/docker-compose.yml
The SERVICE_FQDN_AGENTMEMORY_3111 environment variable is converted from list-item syntax (with - prefix) to a direct mapping key/value assignment.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A dash in the darkness, now turned to light,
YAML list becomes a mapping so right,
One line, one fix, YAML syntax clear,
Docker Compose happy, configuration sincere! 🎉

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and specifically describes the main change: converting environment variable syntax in the Coolify docker-compose config from list to map format to fix v4 parser compatibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant