Spaces:
Sleeping
Sleeping
File size: 813 Bytes
5ab59bf 71888a0 5ab59bf 71888a0 5ab59bf 71888a0 | 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 | FROM python:3.11
WORKDIR /app
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# --- FIX FOR crewai/CHROMA_DB_PATH PERMISSION ERROR ---
# 1. Set the CHROMA_DB_PATH environment variable to a writable path
# This explicitly tells crewai's dependency where to store temporary data,
# bypassing the problematic default path resolution (/root/.local/share/app or /.local/share/app).
ENV CHROMA_DB_PATH="/app/.chroma_data"
# 2. Add a non-root user for security best practice
RUN useradd -m appuser
RUN chown -R appuser:appuser /app
# Switch to the non-root user
USER appuser
# Execute the application
# We use the port 7860 as specified in your original CMD
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|