Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions app/services/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down