167AliRaza commited on
Commit
71888a0
·
verified ·
1 Parent(s): aa06099

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -2
Dockerfile CHANGED
@@ -1,10 +1,26 @@
1
  FROM python:3.11
2
-
3
  WORKDIR /app
4
 
 
5
  COPY requirements.txt .
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
 
8
  COPY . .
9
 
10
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  FROM python:3.11
 
2
  WORKDIR /app
3
 
4
+ # Install dependencies
5
  COPY requirements.txt .
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
8
+ # Copy application code
9
  COPY . .
10
 
11
+ # --- FIX FOR crewai/CHROMA_DB_PATH PERMISSION ERROR ---
12
+ # 1. Set the CHROMA_DB_PATH environment variable to a writable path
13
+ # This explicitly tells crewai's dependency where to store temporary data,
14
+ # bypassing the problematic default path resolution (/root/.local/share/app or /.local/share/app).
15
+ ENV CHROMA_DB_PATH="/app/.chroma_data"
16
+
17
+ # 2. Add a non-root user for security best practice
18
+ RUN useradd -m appuser
19
+ RUN chown -R appuser:appuser /app
20
+
21
+ # Switch to the non-root user
22
+ USER appuser
23
+
24
+ # Execute the application
25
+ # We use the port 7860 as specified in your original CMD
26
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]