fix(db/docker): bootstrap db.json on first run & set DATA_DIR in Docker#447
Open
steel-code-agent wants to merge 3 commits intodecolua:masterfrom
Open
fix(db/docker): bootstrap db.json on first run & set DATA_DIR in Docker#447steel-code-agent wants to merge 3 commits intodecolua:masterfrom
steel-code-agent wants to merge 3 commits intodecolua:masterfrom
Conversation
…ctory (#5) Without this env var the app defaults to ~/.9router/ which doesn't exist inside the container, causing ENOENT on first launch. Co-authored-by: Владимир Акимов <steelmorgan33@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… ENOENT (#6) proper-lockfile calls lstat() on the file before acquiring the lock. If db.json doesn't exist yet (fresh install / Docker), lstat fails with ENOENT before lowdb gets a chance to create it on first write. Co-authored-by: Владимир Акимов <steelmorgan33@gmail.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Two fixes for first-run / Docker deployment issues:
DATA_DIR=/app/datain Dockerfile so the app uses the prepared directory instead of defaulting to~/.9routerdb.jsonwith default schema on first run, preventingproper-lockfileENOENT crashRelated Issues
~/.9router/db.jsonon first runTest plan
db.json, start the app — file is recreated with default schema, no crash/app/data/db.json🤖 Generated with Claude Code