# Copy models downloaded via download_deps.py RUN mkdir -p /ragflow/rag/res/deepdoc /root/.ragflow RUN --mount=type=bind,from=infiniflow/ragflow_deps:latest,source=/huggingface.co,target=/huggingface.co \ cp /huggingface.co/InfiniFlow/huqie/huqie.txt.trie /ragflow/rag/res/ && \ tar --exclude='.*' -cf - \ /huggingface.co/InfiniFlow/text_concat_xgb_v1.0 \ /huggingface.co/InfiniFlow/deepdoc \ | tar -xf - --strip-components=3 -C /ragflow/rag/res/deepdoc RUN --mount=type=bind,from=infiniflow/ragflow_deps:latest,source=/huggingface.co,target=/huggingface.co \ if [ "$LIGHTEN" != "1" ]; then \ (tar -cf - \ /huggingface.co/BAAI/bge-large-zh-v1.5 \ /huggingface.co/BAAI/bge-reranker-v2-m3 \ /huggingface.co/maidalun1020/bce-embedding-base_v1 \ /huggingface.co/maidalun1020/bce-reranker-base_v1 \ | tar -xf - --strip-components=2 -C /root/.ragflow) \ fi
# https://github.com/chrismattmann/tika-python # This is the only way to run python-tika without internet access. Without this set, the default is to check the tika version and pull latest every time from Apache. RUN --mount=type=bind,from=infiniflow/ragflow_deps:latest,source=/,target=/deps \ cp -r /deps/nltk_data /root/ && \ cp /deps/tika-server-standard-3.0.0.jar /deps/tika-server-standard-3.0.0.jar.md5 /ragflow/ && \ cp /deps/cl100k_base.tiktoken /ragflow/9b5ad71b2ce5302211f9c61530b329a4922fc6a4
# nodejs 12.22 on Ubuntu 22.04 is too old RUN --mount=type=cache,id=ragflow_apt,target=/var/cache/apt,sharing=locked \ curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ apt purge -y nodejs npm cargo && \ apt autoremove -y && \ apt update && \ apt install -y nodejs
# A modern version of cargo is needed for the latest version of the Rust compiler. RUN apt update && apt install -y curl build-essential \ && if [ "$NEED_MIRROR" == "1" ]; then \ # Use TUNA mirrors for rustup/rust dist files export RUSTUP_DIST_SERVER="https://mirrors.tuna.tsinghua.edu.cn/rustup"; \ export RUSTUP_UPDATE_ROOT="https://mirrors.tuna.tsinghua.edu.cn/rustup/rustup"; \ echo "Using TUNA mirrors for Rustup."; \ fi; \ # Force curl to use HTTP/1.1 curl --proto '=https' --tlsv1.2 --http1.1 -sSf https://sh.rustup.rs | bash -s -- -y --profile minimal \ && echo 'export PATH="/root/.cargo/bin:${PATH}"' >> /root/.bashrc
services: ragflow: depends_on: mysql: condition:service_healthy build: context:../ dockerfile:Dockerfile container_name:ragflow-server ports: -${SVR_HTTP_PORT}:9380 -80:80 -443:443 volumes: -./ragflow-logs:/ragflow/logs -./nginx/ragflow.conf:/etc/nginx/conf.d/ragflow.conf -./nginx/proxy.conf:/etc/nginx/proxy.conf -./nginx/nginx.conf:/etc/nginx/nginx.conf -../:/ragflow env_file:.env environment: -TZ=${TIMEZONE} -HF_ENDPOINT=${HF_ENDPOINT} -MACOS=${MACOS:-1} -LIGHTEN=${LIGHTEN:-1} networks: -ragflow restart:on-failure # https://docs.docker.com/engine/daemon/prometheus/#create-a-prometheus-configuration # If you're using Docker Desktop, the --add-host flag is optional. This flag makes sure that the host's internal IP gets exposed to the Prometheus container. extra_hosts: -"host.docker.internal:host-gateway"
# replace env variables in the service_conf.yaml file rm -rf /ragflow/conf/service_conf.yaml while IFS= read -r line || [[ -n "$line" ]]; do # Use eval to interpret the variable with default values eval"echo \"$line\"" >> /ragflow/conf/service_conf.yaml done < /ragflow/conf/service_conf.yaml.template
/usr/sbin/nginx
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/
PY=python3 if [[ -z "$WS" || $WS -lt 1 ]]; then WS=1 fi