Skip to content

fix(compose): parameterize data-path env vars in production compose - #451

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

fix(compose): parameterize data-path env vars in production compose#451
MS-Jahan wants to merge 1 commit into
rmyndharis:mainfrom
MS-Jahan:fix/prod-compose-overridable-paths

Conversation

@MS-Jahan

Copy link
Copy Markdown
Contributor

Summary

In docker-compose.yml, three documented user-facing data-path settings were hardcoded while their sibling DATABASE_NAME was already overridable:

Var In .env.example? Before After
DATABASE_NAME yes ${DATABASE_NAME:-/app/data/openwa.sqlite} (unchanged)
SESSION_DATA_PATH yes /app/data/sessions ${SESSION_DATA_PATH:-/app/data/sessions}
STORAGE_LOCAL_PATH yes /app/data/media ${STORAGE_LOCAL_PATH:-/app/data/media}
PLUGINS_DIR yes /app/data/plugins ${PLUGINS_DIR:-/app/data/plugins}

All three are read from the environment in the app (src/config/configuration.ts) and documented in .env.example, so hardcoding them in the compose file was an inconsistency. This converts them to the ${VAR:-default} pattern, matching DATABASE_NAME and the rest of the file.

Safety / behavior

  • Defaults are identical and stay under /app/data (the openwa-data volume that the entrypoint chowns), so persistence and the read_only rootfs posture are unchanged out of the box.
  • Overriding to a path outside /app/data is an advanced, opt-in action — the same caveat that already applies to DATABASE_NAME.

Intentionally left fixed

HOME, XDG_CONFIG_HOME, XDG_CACHE_HOME, PORT, DOCKER_HOST — genuinely container-internal values tied to the image/entrypoint, EXPOSE/healthcheck, and the docker-proxy service topology.

Test plan

  • docker compose -f docker-compose.yml config parses successfully
  • docker compose up with no overrides uses the prior /app/data/* defaults
  • Setting e.g. PLUGINS_DIR in .env is reflected in the container env

Companion to the dev-compose change in #450 (keeps the two files consistent).

Made with Cursor

SESSION_DATA_PATH, STORAGE_LOCAL_PATH and PLUGINS_DIR were hardcoded
while their sibling DATABASE_NAME was already overridable, despite all
four being documented user-facing settings in .env.example. Convert
them to the ${VAR:-default} pattern for consistency.

Defaults are unchanged and stay under /app/data (the openwa-data
volume), so persistence and the read-only-rootfs posture are unaffected
out of the box; advanced users can now relocate them without editing
the compose file.

Genuinely container-internal values (HOME, XDG_*, PORT, DOCKER_HOST)
remain fixed by design.

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

Copy link
Copy Markdown
Owner

Incorporated into v0.7.1 (commit f1c5f03), rebased onto the engine-config relocation. 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