samu commited on
Commit
e350ce8
·
1 Parent(s): d08ac14

sqlite and docker issues

Browse files
Files changed (2) hide show
  1. Dockerfile +14 -5
  2. docker-compose.yml +9 -11
Dockerfile CHANGED
@@ -1,10 +1,19 @@
1
  FROM python:3.12-slim
2
 
3
- COPY ./ ./
 
4
 
5
- # Install dependencies
6
- RUN pip install --no-cache --upgrade -r /requirements.txt
 
7
 
8
- # Start the application
9
- CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "2"]
 
 
 
 
 
10
 
 
 
 
1
  FROM python:3.12-slim
2
 
3
+ # Set working directory
4
+ WORKDIR /app
5
 
6
+ # Copy requirements and install dependencies
7
+ COPY requirements.txt .
8
+ RUN pip install --no-cache-dir -r requirements.txt
9
 
10
+ # Copy schema, backend files, and environment config
11
+ COPY backend/schema.sql .
12
+ COPY backend/ backend/
13
+ COPY .env* ./
14
+
15
+ # Expose port
16
+ EXPOSE 7860
17
 
18
+ # Start the application
19
+ CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "2"]
docker-compose.yml CHANGED
@@ -1,19 +1,17 @@
1
  services:
2
- api: # Changed from 'web' to 'api'
3
  build: .
4
  ports:
5
- - "${API_PORT:-8000}:8000"
6
  volumes:
7
- - ./output:/code/output
 
 
8
  environment:
9
  - API_KEY=${API_KEY}
10
- - OLLAMA_API_KEY=${OLLAMA_API_KEY}
11
- - API_PORT=${API_PORT}
 
12
  env_file:
13
  - .env
14
- restart: unless-stopped
15
- develop:
16
- watch:
17
- - action: sync
18
- path: .
19
- target: /code
 
1
  services:
2
+ backend:
3
  build: .
4
  ports:
5
+ - "8000:8000"
6
  volumes:
7
+ - ./backend:/app/backend
8
+ - ./backend/schema.sql:/app/schema.sql
9
+ - ./ai_tutor.db:/app/ai_tutor.db
10
  environment:
11
  - API_KEY=${API_KEY}
12
+ - BASE_URL=${BASE_URL}
13
+ - MODEL=${MODEL:-gemini-2.0-flash}
14
+ - DATABASE_PATH=./ai_tutor.db
15
  env_file:
16
  - .env
17
+ restart: unless-stopped