Fix Docker volume mount paths in README to prevent data loss on container recreate - #707
hitesh-ctrl wants to merge 1 commit into
Conversation
The docker run instructions mounted middleware_postgres_data to /var/lib/postgresql/data and middleware_keys to /app/keys, but the production image installs Postgres 15 via apt (which stores data at /var/lib/postgresql/15/main) and keeps app config at /app/backend/analytics_server/mhq/config. Neither README path is actually used by the running services, so writes land in the container's writable layer instead of the named volumes. Data survives a plain `docker restart` (same layer) but is lost on `docker rm` + recreate, matching the symptoms in middlewarehq#693. The correct paths already match what docker-compose.yml uses for local dev. Fixes middlewarehq#693 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. WalkthroughThe README updates both Docker commands to mount PostgreSQL data and keys volumes at their new container paths. ChangesDocker volume documentation
Estimated code review effort: 1 (Trivial) | ~3 minutes Merge Risk: ⚪ Minimal · up to Docker installation and update instructions now direct persistent volumes to the application’s active database and configuration paths, preventing recreated containers from using incorrect mount locations. The change is ready to merge. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Summary
Fixes #693.
The
docker runcommands in the README mount the named volumes to paths that the running services never actually write to:middleware_postgres_datais mounted at/var/lib/postgresql/data, but the productionDockerfileinstalls Postgres 15 viaapt, which stores its data at/var/lib/postgresql/15/main(see thepg_hba.conf/postgresql.confedits during build, which only make sense at that path).middleware_keysis mounted at/app/keys, which doesn't exist anywhere in the image. The app's actual config directory (config.ini, integration secrets, etc.) is/app/backend/analytics_server/mhq/config.Because neither path is real, Postgres and the app config write to the container's writable layer instead of the named volumes — which is why
docker volume inspect/duon the volumes shows next to nothing. Adocker restartpreserves data because it's the same container layer, butdocker rm+ recreate wipes it, exactly matching the symptoms in #693.The corrected paths already match what
docker-compose.yml(used for local dev) mounts:Changes
README.md: corrected bothdocker runexamples (initial install and the "fetch latest" troubleshooting step) to mount volumes at the paths the app actually uses.Test plan
docker-compose.ymldev setup.docker rm+ recreate, confirm persistence) was not completed due to slow network conditions in the environment used to prepare this PR — happy to run it if a maintainer wants confirmation, or a maintainer/reviewer can quickly confirm given local Docker access.🤖 Generated with Claude Code
Summary by CodeRabbit