Skip to content

Commit d703c82

Browse files
committed
Switch to Docker deployment to fix Python version and ChromaDB initialization
1 parent 8569cfe commit d703c82

File tree

2 files changed

+33
-6
lines changed

2 files changed

+33
-6
lines changed

backend/Dockerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Use a stable, official Python 3.11 image
2+
FROM python:3.11-slim
3+
4+
# Set environment variables
5+
ENV PYTHONUNBUFFERED=1 \
6+
PYTHONDONTWRITEBYTECODE=1 \
7+
PORT=8000
8+
9+
# Install system dependencies (needed for certain PDF/DocX parsers)
10+
RUN apt-get update && apt-get install -y \
11+
build-essential \
12+
curl \
13+
&& rm -rf /var/lib/apt/lists/*
14+
15+
# Set working directory
16+
WORKDIR /app
17+
18+
# Install dependencies
19+
COPY requirements.txt .
20+
RUN pip install --no-cache-dir -r requirements.txt
21+
22+
# Copy application code
23+
COPY . .
24+
25+
# Create persistent directories (mirrored to our Render disk)
26+
RUN mkdir -p /data/chroma_db
27+
28+
# Expose the port
29+
EXPOSE 8000
30+
31+
# Start command
32+
CMD ["gunicorn", "main:app", "--workers", "2", "--worker-class", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:8000"]

render.yaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
services:
22
- type: web
33
name: sidequest-backend
4-
env: python
4+
env: docker
55
rootDir: backend
6-
pythonVersion: 3.11.9
7-
buildCommand: pip install -r requirements.txt
8-
startCommand: gunicorn main:app --workers 2 --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:$PORT
96
envVars:
107
- key: DATABASE_URL
118
value: sqlite:////data/sidequest.db
129
- key: CHROMA_SERVER_NOFILE
1310
value: "65535"
1411
- key: CHROMA_PERSIST_PATH
1512
value: /data/chroma_db
16-
- key: PYTHON_VERSION
17-
value: 3.11.9
1813
- key: GEMINI_API_KEY
1914
sync: false
2015
- key: FRONTEND_URL

0 commit comments

Comments
 (0)