diff --git a/README.md b/README.md index e9b3614..03769e2 100644 --- a/README.md +++ b/README.md @@ -32,19 +32,13 @@ services: restart: unless-stopped ports: - "8000:8000" - environment: - # Database path inside the container - - DB_PATH=/app/data/whois_cache.db volumes: - # Data persistence (WHOIS cache) - - ./gptkit_data:/app/data -``` - -### Environment Variables + # Data persistence (WHOIS cache stored in /app/data/whois_cache.db) + - gptkit_data:/app/data -| Variable | Description | Default | -|----------|-------------|--------| -| `DB_PATH` | Path to the SQLite database file | `whois_cache.db` | +volumes: + gptkit_data: +``` ## Development diff --git a/app/services/cache.py b/app/services/cache.py index abb2478..7043499 100644 --- a/app/services/cache.py +++ b/app/services/cache.py @@ -5,8 +5,9 @@ import os class WhoisCache: - def __init__(self, db_path: str = None): - self.db_path = db_path or os.getenv("DB_PATH", "whois_cache.db") + def __init__(self): + self.db_path = "data/whois_cache.db" + os.makedirs(os.path.dirname(self.db_path), exist_ok=True) self._init_db() def _init_db(self):