File size: 1,455 Bytes
676bcae
e22dcc4
 
 
 
676bcae
e22dcc4
 
 
676bcae
 
e22dcc4
676bcae
 
 
 
 
 
e22dcc4
 
676bcae
 
e22dcc4
676bcae
 
 
e22dcc4
34044b2
 
 
676bcae
e22dcc4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
version: "3.8"

services:
  backend:
    build:
      context: ./backend          # <─ your backend folder on host
      dockerfile: Dockerfile
    ports:
      - "8000:8000"

    # ── Environment the code expects ─────────────────────────────
    environment:
      # β—Ό SQLite file lives in the same folder as your code
      - DATABASE_URL=sqlite:///./pdf_chatbot.db
      # β—Ό Chroma + uploads are relative to the WORKDIR (/app/backend)
      - CHROMA_PERSIST_DIRECTORY=./chroma_db
      - UPLOAD_DIR=./uploads
      # other settings
      - MAX_FILE_SIZE=10485760
      - ALLOWED_EXTENSIONS=[".pdf"]
      - BACKEND_CORS_ORIGINS=["http://localhost:3000","http://localhost:3001",
                              "http://127.0.0.1:3000","http://127.0.0.1:3001"]
    env_file:
      - ./backend/.env        # optional extra secrets

    # ── Persist data on host in the same structure you already have ──
    volumes:
      - ./backend/uploads:/app/backend/uploads
      - ./backend/chroma_db:/app/backend/chroma_db
      - ./backend/pdf_chatbot.db:/app/backend/pdf_chatbot.db

    restart: unless-stopped

  frontend:
    build:
      context: ./frontend
      dockerfile: Dockerfile
    ports:
      - "3000:3000"
    environment:
      - NEXT_PUBLIC_API_URL=http://localhost:8000
    env_file:
      - ./frontend/.env
    depends_on:
      - backend
    restart: unless-stopped