# 1. Use an official Python runtime as a parent image FROM python:3.11-slim # 2. Set the working directory in the container WORKDIR /app # 3. Tell Hugging Face libraries to use a writable cache directory ENV HF_HOME=/tmp/huggingface_cache # 3. Install system dependencies required by faiss-cpu # This replaces the need for packages.txt RUN apt-get update && apt-get install -y --no-install-recommends \ libopenblas-dev \ && rm -rf /var/lib/apt/lists/* # 4. Copy the requirements file into the container at /app COPY requirements.txt . # 5. Install any needed packages specified in requirements.txt RUN pip install --no-cache-dir -r requirements.txt # 6. Copy the rest of your application's code into the container COPY . . # 7. Expose the port Streamlit will run on. HF expects 7860. EXPOSE 7860 # 8. Define the command to run your app # This runs when the container launches. #CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"] #CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--browser.gatherUsageStats=false"] CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0", "--browser.gatherUsageStats=false", "--server.enableCORS=false", "--server.enableXsrfProtection=false"]