Spaces:
Running
Running
File size: 1,289 Bytes
a76e442 5e5fd4f a76e442 5e5fd4f d9dd61b a76e442 5e5fd4f a76e442 5e5fd4f a76e442 5e5fd4f a76e442 5e5fd4f a76e442 5e5fd4f a76e442 91db99a 91851d9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# 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"] |