Spaces:
Sleeping
Sleeping
| FROM python:3.9-slim | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements and install | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy all files | |
| COPY . . | |
| # Ensure tmp directory exists with proper permissions | |
| RUN mkdir -p /app/tmp | |
| RUN chmod -R 777 /app/tmp | |
| RUN chmod 777 /app | |
| # Create .streamlit config directory | |
| RUN mkdir -p /app/.streamlit | |
| RUN echo "\ | |
| [browser]\n\ | |
| gatherUsageStats = false\n\ | |
| [server]\n\ | |
| fileWatcherType = 'none'\n\ | |
| " > /app/.streamlit/config.toml | |
| RUN chmod -R 777 /app/.streamlit | |
| # Set environment variables | |
| ENV STREAMLIT_SERVER_PORT=8501 | |
| ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0 | |
| ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false | |
| ENV TMPDIR=/app/tmp | |
| # Set the entry point to the correct file path | |
| ENTRYPOINT ["streamlit", "run", "src/app.py", "--server.address=0.0.0.0", "--server.port=8501"] |