FROM python:3.9-slim # Set the working directory inside the container to /app WORKDIR /app # --- FIX: Set Hugging Face cache location to a writable directory (/tmp) --- ENV HF_HOME="/tmp/hf_cache" # --- Also setting standard Streamlit ENV variables --- ENV STREAMLIT_SERVER_PORT=7860 \ STREAMLIT_SERVER_ADDRESS=0.0.0.0 \ STREAMLIT_BROWSER_GATHER_USAGE_STATS=false \ STREAMLIT_GLOBAL_DIR="/tmp/streamlit_global" # Copy all files from the current directory on the host to the container's /app directory COPY . . # Install Python dependencies listed in requirements.txt RUN pip3 install -r requirements.txt # Define the command to run the Streamlit app CMD ["streamlit", "run", "app.py"]