Spaces:
Runtime error
Runtime error
Updated Dockerfile to resolve cache issues
Browse files12345678910111213141516171819202122232425262728293031# Use Python 3.13 slim as the base imageFROM python:3.13-slim# Install git and other necessary packagesRUN apt-get update && apt-get install -y \git \&& rm -rf /var/lib/apt/lists/*# Expose the secret GROQ_API_KEY at buildtime and use its value as git remote URLRUN --mount=type=secret,id=GROQ_API_KEY,mode=0444,required=true \git init && \git remote add origin $(cat /run/secrets/GROQ_API_KEY)# Set the working directoryWORKDIR /app# Copy app folderCOPY app/ .# Copy requirements and installCOPY requirements.txt .RUN pip install --no-cache-dir -r requirements.txt# Download the BGE embedding modelRUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('BAAI/bge-small-en-v1.5')"# Expose Gradio's default portEXPOSE 7860# Run the appCMD ["python", "app.py"]1234567891011121314151617181920212223242526272829303132333435363738# Use Python 3.13 slim as the base imageFROM python:3.13-slim# Install git and other necessary packagesRUN apt-get update && apt-get install -y \git \&& rm -rf /var/lib/apt/lists/*# Expose the secret GROQ_API_KEY at buildtime and use its value as git remote URLRUN --mount=type=secret,id=GROQ_API_KEY,mode=0444,required=true \git init && \git remote add origin $(cat /run/secrets/GROQ_API_KEY)# Set the working directoryWORKDIR /app# Create cache directory with proper permissionsRUN mkdir -p /.cache && chmod 777 /.cache# Set environment variable for transformers cacheENV TRANSFORMERS_CACHE=/.cache/transformersENV HF_HOME=/.cache/huggingface# Copy requirements and installCOPY requirements.txt .RUN pip install --no-cache-dir -r requirements.txt# Download the BGE embedding modelRUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('BAAI/bge-small-en-v1.5')"# Copy app folderCOPY app/ .# Expose Gradio's default portEXPOSE 7860# Run the appCMD ["python", "app.py"]
Dockerfile+37-30