Skip to content

fix(compose): make dev compose environment variables overridable - #450

Closed
MS-Jahan wants to merge 1 commit into
rmyndharis:mainfrom
MS-Jahan:fix/dev-compose-overridable-env
Closed

fix(compose): make dev compose environment variables overridable#450
MS-Jahan wants to merge 1 commit into
rmyndharis:mainfrom
MS-Jahan:fix/dev-compose-overridable-env

Conversation

@MS-Jahan

@MS-Jahan MS-Jahan commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Summary

docker-compose.dev.yml hardcoded most environment variables to fixed literal values (e.g. NODE_ENV=development, DATABASE_TYPE=sqlite, PUPPETEER_HEADLESS=true, WEBHOOK_TIMEOUT=10000, ...). There was no way to override them from the shell environment or an .env file without editing the compose file.

This converts the user-facing settings to the ${VAR:-default} pattern — same defaults as before, but now overridable — bringing the dev compose in line with the production docker-compose.yml.

Made overridable (default unchanged)

NODE_ENV, DATABASE_TYPE, DATABASE_NAME, DATABASE_SYNCHRONIZE, ENGINE_TYPE, PUPPETEER_HEADLESS, PUPPETEER_ARGS, STORAGE_TYPE, WEBHOOK_TIMEOUT, WEBHOOK_MAX_RETRIES, QUEUE_ENABLED, plus the data-path settings documented in .env.example: SESSION_DATA_PATH, STORAGE_LOCAL_PATH. Also added LOG_LEVEL=${LOG_LEVEL:-info} for parity with production.

The data-path defaults stay under /app/data (the ./data bind mount), so persistence is unchanged out of the box; override only if you mount that target elsewhere.

Intentionally kept fixed

PORT, HOME, XDG_CONFIG_HOME, XDG_CACHE_HOME — container-internal values that must match the image/entrypoint. Production keeps these fixed for the same reason.

Notes

  • WWEBJS_* were already parameterized; unchanged.
  • Defaults are identical to the previous literals, so existing docker compose -f docker-compose.dev.yml up behavior is unchanged when no env is set.

Test plan

  • docker compose -f docker-compose.dev.yml config parses successfully
  • docker compose -f docker-compose.dev.yml up with no env uses the prior defaults
  • Setting e.g. LOG_LEVEL=debug / PUPPETEER_HEADLESS=false in .env overrides the defaults

The dev compose hardcoded most environment variables to fixed values,
so operators couldn't override them from the environment / .env without
editing the file. Convert user-facing settings to the ${VAR:-default}
pattern (keeping the same defaults), matching the production compose.

This includes the data-path settings that are documented in .env.example
(SESSION_DATA_PATH, STORAGE_LOCAL_PATH) — defaults stay under /app/data
(the ./data bind mount) so persistence is unchanged out of the box.

Truly container-internal values (HOME, XDG_*, PORT) stay fixed: they
must match the image/entrypoint, so they are intentionally not
parameterized — same convention as docker-compose.yml.

Co-authored-by: Cursor <cursoragent@cursor.com>
@rmyndharis

Copy link
Copy Markdown
Owner

Incorporated into v0.7.1 (commit 96b4998) with one reconciliation: the ENGINE_TYPE line was dropped. v0.7.1 moves engine selection to the dashboard (Infrastructure → Engine); since main.ts loads .env.generated with override:false, pinning ENGINE_TYPE as a container env would silently override the dashboard's choice. Your overridable pattern for every other var is in, and PLUGINS_DIR was preserved (+ made overridable). Thanks @MS-Jahan! 🙏

@rmyndharis rmyndharis closed this Jun 23, 2026
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.

2 participants