Spaces:
Sleeping
Sleeping
File size: 2,968 Bytes
d456104 0a7b980 b0fe8ca | 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 33 34 35 36 37 38 39 40 | # ββ Base image βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Python 3.11 slim keeps the image small while being recent enough for all deps.
FROM python:3.11-slim
# ββ System dependencies ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# cmake + build-essential are required to compile llama-cpp-python from source
# if a pre-built wheel is not available for the target platform.
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
# ββ Working directory ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
WORKDIR /app
# ββ Python dependencies ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# Copy requirements first to leverage Docker layer caching.
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
# ββ Application code βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
COPY . .
# Create data directories (they may be empty in the repo)
RUN mkdir -p data/raw data/vector_db data/models
# ββ Expose Streamlit port ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
EXPOSE 8501
# ββ Health check βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:8501/_stcore/health || exit 1
# ββ Entrypoint βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
# ββ Entrypoint βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
CMD ["sh", "-c", "python scripts/ingest.py 2>/dev/null || true && streamlit run app/main.py --server.port=7860 --server.address=0.0.0.0 --server.headless=true --server.maxUploadSize=200 --server.enableXsrfProtection=false"]
|