Spaces:
Sleeping
Sleeping
sqlite and docker issues
Browse files- Dockerfile +14 -5
- docker-compose.yml +9 -11
Dockerfile
CHANGED
@@ -1,10 +1,19 @@
|
|
1 |
FROM python:3.12-slim
|
2 |
|
3 |
-
|
|
|
4 |
|
5 |
-
#
|
6 |
-
|
|
|
7 |
|
8 |
-
#
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
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 |
-
|
3 |
build: .
|
4 |
ports:
|
5 |
-
- "
|
6 |
volumes:
|
7 |
-
- ./
|
|
|
|
|
8 |
environment:
|
9 |
- API_KEY=${API_KEY}
|
10 |
-
-
|
11 |
-
-
|
|
|
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
|
|
|
|
|
|
|
|
|
|