You've already forked DataMate
* feature: unstructured支持简单pdf处理 * feature: update values.yaml to enhance ray-cluster configuration with security context, environment variables, and resource limits * fix: update Dockerfile to improve pip installation process and remove unnecessary uninstalls
35 lines
1.3 KiB
Docker
35 lines
1.3 KiB
Docker
FROM ghcr.io/astral-sh/uv:python3.11-bookworm
|
|
|
|
RUN --mount=type=cache,target=/var/cache/apt \
|
|
--mount=type=cache,target=/var/lib/apt \
|
|
apt update \
|
|
&& apt install -y libgl1 libglib2.0-0 vim libmagic1 libreoffice dos2unix swig
|
|
|
|
RUN mkdir -p /home/models \
|
|
&& wget https://paddleocr.bj.bcebos.com/dygraph_v2.0/ch/ch_ppocr_mobile_v2.0_cls_infer.tar \
|
|
&& tar -xf ch_ppocr_mobile_v2.0_cls_infer.tar -C /home/models \
|
|
&& rm -f ch_*.tar
|
|
|
|
COPY runtime/python-executor /opt/runtime
|
|
COPY runtime/ops /opt/runtime/datamate/ops
|
|
COPY runtime/ops/user /opt/runtime/user
|
|
COPY scripts/images/runtime/start.sh /opt/runtime/start.sh
|
|
|
|
ENV PYTHONPATH=/opt/runtime/datamate/
|
|
|
|
WORKDIR /opt/runtime
|
|
|
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
UV_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu" uv pip install -e . --system --index-strategy unsafe-best-match \
|
|
&& UV_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cpu" uv pip install -r /opt/runtime/datamate/ops/pyproject.toml --system \
|
|
&& uv pip uninstall torch torchvision --system \
|
|
&& python -m spacy download zh_core_web_sm
|
|
|
|
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
|
&& chmod +x /opt/runtime/start.sh \
|
|
&& dos2unix /opt/runtime/start.sh
|
|
|
|
EXPOSE 8081
|
|
|
|
ENTRYPOINT ["/opt/runtime/start.sh"]
|