fix(compose): parameterize data-path env vars in production compose - #451
Closed
MS-Jahan wants to merge 1 commit into
Closed
fix(compose): parameterize data-path env vars in production compose#451MS-Jahan wants to merge 1 commit into
MS-Jahan wants to merge 1 commit into
Conversation
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>
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In
docker-compose.yml, three documented user-facing data-path settings were hardcoded while their siblingDATABASE_NAMEwas already overridable:.env.example?DATABASE_NAME${DATABASE_NAME:-/app/data/openwa.sqlite}SESSION_DATA_PATH/app/data/sessions${SESSION_DATA_PATH:-/app/data/sessions}STORAGE_LOCAL_PATH/app/data/media${STORAGE_LOCAL_PATH:-/app/data/media}PLUGINS_DIR/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, matchingDATABASE_NAMEand the rest of the file.Safety / behavior
/app/data(theopenwa-datavolume that the entrypoint chowns), so persistence and theread_onlyrootfs posture are unchanged out of the box./app/datais an advanced, opt-in action — the same caveat that already applies toDATABASE_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 configparses successfullydocker compose upwith no overrides uses the prior/app/data/*defaultsPLUGINS_DIRin.envis reflected in the container envCompanion to the dev-compose change in #450 (keeps the two files consistent).
Made with Cursor