Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

build_docker_image.mdx 3.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. ---
  2. sidebar_position: 1
  3. slug: /build_docker_image
  4. ---
  5. # Build a RAGFlow Docker Image
  6. import Tabs from '@theme/Tabs';
  7. import TabItem from '@theme/TabItem';
  8. A guide explaining how to build a RAGFlow Docker image from its source code. By following this guide, you'll be able to create a local Docker image that can be used for development, debugging, or testing purposes.
  9. ## Target Audience
  10. - Developers who have added new features or modified the existing code and require a Docker image to view and debug their changes.
  11. - Developers seeking to build a RAGFlow Docker image for an ARM64 platform.
  12. - Testers aiming to explore the latest features of RAGFlow in a Docker image.
  13. ## Prerequisites
  14. - CPU ≥ 4 cores
  15. - RAM ≥ 16 GB
  16. - Disk ≥ 50 GB
  17. - Docker ≥ 24.0.0 & Docker Compose ≥ v2.26.1
  18. ## Build a Docker image
  19. <Tabs
  20. defaultValue="without"
  21. values={[
  22. {label: 'Build a Docker image without embedding models', value: 'without'},
  23. {label: 'Build a Docker image including embedding models', value: 'including'}
  24. ]}>
  25. <TabItem value="without">
  26. This image is approximately 2 GB in size and relies on external LLM and embedding services.
  27. :::danger IMPORTANT
  28. - While we also test RAGFlow on ARM64 platforms, we do not maintain RAGFlow Docker images for ARM. However, you can build an image yourself on a `linux/arm64` or `darwin/arm64` host machine as well.
  29. - For ARM64 platforms, please upgrade the `xgboost` version in **pyproject.toml** to `1.6.0` and ensure **unixODBC** is properly installed.
  30. :::
  31. ```bash
  32. git clone https://github.com/infiniflow/ragflow.git
  33. cd ragflow/
  34. uv run download_deps.py
  35. docker build -f Dockerfile.deps -t infiniflow/ragflow_deps .
  36. docker build --build-arg LIGHTEN=1 -f Dockerfile -t infiniflow/ragflow:nightly-slim .
  37. ```
  38. </TabItem>
  39. <TabItem value="including">
  40. This image is approximately 9 GB in size. As it includes embedding models, it relies on external LLM services only.
  41. :::danger IMPORTANT
  42. - While we also test RAGFlow on ARM64 platforms, we do not maintain RAGFlow Docker images for ARM. However, you can build an image yourself on a `linux/arm64` or `darwin/arm64` host machine as well.
  43. - For ARM64 platforms, please upgrade the `xgboost` version in **pyproject.toml** to `1.6.0` and ensure **unixODBC** is properly installed.
  44. :::
  45. ```bash
  46. git clone https://github.com/infiniflow/ragflow.git
  47. cd ragflow/
  48. uv run download_deps.py
  49. docker build -f Dockerfile.deps -t infiniflow/ragflow_deps .
  50. docker build -f Dockerfile -t infiniflow/ragflow:nightly .
  51. ```
  52. </TabItem>
  53. </Tabs>
  54. ## Launch a RAGFlow Service from Docker for MacOS
  55. After building the infiniflow/ragflow:nightly-slim image, you are ready to launch a fully-functional RAGFlow service with all the required components, such as Elasticsearch, MySQL, MinIO, Redis, and more.
  56. ## Example: Apple M2 Pro (Sequoia)
  57. 1. Edit Docker Compose Configuration
  58. Open the `docker/docker-compose-base.yml` file. Find the `infinity.image` setting and change the image reference from `infiniflow/infinity:v0.6.0-dev3` to `infiniflow/ragflow:nightly-slim` to use the pre-built image.
  59. ```yaml
  60. infinity:
  61. container_name: ragflow-infinity
  62. image: infiniflow/ragflow:nightly-slim # here
  63. volumes:
  64. - ...
  65. - ...
  66. ...
  67. ```
  68. 2. Launch the Service
  69. ```bash
  70. cd docker
  71. $ docker compose -f docker-compose-macos.yml up -d
  72. ```
  73. 3. Access the RAGFlow Service
  74. Once the setup is complete, open your web browser and navigate to http://127.0.0.1 or your server's \<IP_ADDRESS\>; (the default port is \<PORT\> = 80). You will be directed to the RAGFlow welcome page. Enjoy!🍻