Spaces:
Sleeping
Sleeping
| FROM python:3.10-slim | |
| WORKDIR /app | |
| # Install system packages | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| curl \ | |
| git \ | |
| ffmpeg \ | |
| cmake \ | |
| libopenblas-dev \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # === CRITICAL FIX === | |
| # Set Streamlit to use temporary directories for ALL storage | |
| ENV HOME=/tmp | |
| ENV STREAMLIT_GLOBAL_DEVELOPMENT_MODE=false | |
| ENV STREAMLIT_GLOBAL_DATA_PATH=/tmp | |
| ENV STREAMLIT_CONFIG_DIR=/tmp/.streamlit | |
| ENV HF_HOME=/tmp/huggingface | |
| # Create directories with open permissions | |
| RUN mkdir -p /tmp/.streamlit /tmp/huggingface && \ | |
| chmod -R 777 /tmp | |
| # Create config file with proper settings | |
| RUN mkdir -p /tmp/.streamlit && \ | |
| cat <<EOF > /tmp/.streamlit/config.toml | |
| [browser] | |
| gatherUsageStats = false | |
| [server] | |
| enableCORS = false | |
| enableXsrfProtection = false | |
| EOF | |
| # Copy files | |
| COPY requirements.txt ./ | |
| COPY src/ ./src/ | |
| # Install Python dependencies | |
| RUN pip3 install --no-cache-dir -r requirements.txt | |
| EXPOSE 8501 | |
| HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health | |
| ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", \ | |
| "--server.port=8501", \ | |
| "--server.address=0.0.0.0"] |