fix: ensure data persistence across reinstallations
- Add entrypoint.sh: creates /app/data, stamps legacy DBs, runs alembic upgrade head - Update Dockerfile to use new entrypoint and pre-create /app/data - Change default DATABASE_URL to sqlite:///./data/dmarq.db - Add _ensure_sqlite_dir() to database.py for automatic directory creation - Update docker-compose.yml with app_data named volume for /app/data - Add 6 tests for _ensure_sqlite_dir and updated default URL Agent-Logs-Url: https://github.com/christianlouis/dmarq/sessions/2bac317b-97a2-450b-84f1-3e316f7ef54c Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -23,7 +23,9 @@ class Settings(BaseSettings):
|
||||
API_V1_STR: str = "/api/v1"
|
||||
|
||||
# Database
|
||||
DATABASE_URL: str = "sqlite:///./dmarq.db"
|
||||
# Default to a sub-directory so the SQLite file lives in a location that
|
||||
# can be persisted via a Docker volume mount (e.g. /app/data).
|
||||
DATABASE_URL: str = "sqlite:///./data/dmarq.db"
|
||||
|
||||
# JWT Authentication
|
||||
SECRET_KEY: Optional[str] = None
|
||||
|
||||
Reference in New Issue
Block a user