mirror of
https://github.com/zebrajr/localGPT.git
synced 2025-12-06 00:20:19 +01:00
fix: resolve Docker container SQLite database path issue
- Updated database path from relative 'backend/chat_data.db' to absolute '/app/backend/chat_data.db' - Modified docker-compose.yml to mount entire backend directory for proper database persistence - Updated Dockerfile.backend to ensure backend directory exists in container - Fixes GitHub issue #849: sqlite3.OperationalError unable to open database file Co-Authored-By: PromptEngineer <jnfarooq@outlook.com>
This commit is contained in:
parent
3e3e83c41a
commit
f21686f51c
|
|
@ -16,8 +16,8 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|||
COPY backend/ ./backend/
|
||||
COPY rag_system/ ./rag_system/
|
||||
|
||||
# Create necessary directories
|
||||
RUN mkdir -p shared_uploads logs
|
||||
# Create necessary directories and initialize database
|
||||
RUN mkdir -p shared_uploads logs backend
|
||||
|
||||
# Expose port
|
||||
EXPOSE 8000
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ from datetime import datetime
|
|||
from typing import List, Dict, Optional, Tuple
|
||||
|
||||
class ChatDatabase:
|
||||
def __init__(self, db_path: str = "backend/chat_data.db"):
|
||||
def __init__(self, db_path: str = "/app/backend/chat_data.db"):
|
||||
self.db_path = db_path
|
||||
self.init_database()
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ services:
|
|||
- NODE_ENV=production
|
||||
- RAG_API_URL=http://rag-api:8001
|
||||
volumes:
|
||||
- ./backend/chat_data.db:/app/backend/chat_data.db
|
||||
- ./backend:/app/backend
|
||||
- ./shared_uploads:/app/shared_uploads
|
||||
depends_on:
|
||||
rag-api:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user