|
|
|
FROM python:3.10-slim |
|
|
|
RUN useradd -m -u 1000 user |
|
USER user |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN apt-get update && \ |
|
apt-get install -y --no-install-recommends \ |
|
build-essential \ |
|
ffmpeg \ |
|
|
|
libgomp1 \ |
|
curl \ |
|
git && \ |
|
rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
COPY requirements.txt ./ |
|
RUN pip install uv && \ |
|
pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch2.1/index.html && \ |
|
uv pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
RUN curl -L https://github.com/opendatalab/MinerU/raw/dev/scripts/download_models_hf.py -o download_models_hf.py && \ |
|
python download_models_hf.py |
|
|
|
|
|
COPY src/ ./src/ |
|
|
|
|
|
COPY app.py . |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
ENV PYTHONUNBUFFERED=1 |
|
ENV TOKENIZERS_PARALLELISM=false |
|
|
|
|
|
ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"] |
|
|