# Use a small Python base | |
FROM python:3.11-slim | |
ENV PYTHONDONTWRITEBYTECODE=1 \ | |
PYTHONUNBUFFERED=1 \ | |
PIP_NO_CACHE_DIR=1 | |
# System deps (build tools + fonts for Streamlit + pdf parsing) | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
build-essential curl git libglib2.0-0 libsm6 libxext6 libxrender1 \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Workdir | |
WORKDIR /app | |
# Python deps first (better caching) | |
COPY requirements.txt /app/ | |
RUN pip install -r requirements.txt | |
# App code | |
COPY app.py /app/ | |
# Hugging Face Spaces sets $PORT. Streamlit must bind to it. | |
EXPOSE 7860 | |
CMD ["bash", "-lc", "streamlit run app.py --server.port $PORT --server.address 0.0.0.0"] | |