Skip to content

Commit

Permalink
Added doc on dev-slim (infiniflow#2627)
Browse files Browse the repository at this point in the history
Added doc on dev-slim

### Type of change

- [x] Documentation Update
- [x] Refactoring

---------

Co-authored-by: Kevin Hu <[email protected]>
  • Loading branch information
yuzhichang and KevinHuSh authored Sep 27, 2024
1 parent 183e214 commit af4b674
Show file tree
Hide file tree
Showing 5 changed files with 186 additions and 1,889 deletions.
11 changes: 7 additions & 4 deletions Dockerfile.scratch → Dockerfile.slim
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
FROM ubuntu:24.04 AS base
USER root

ENV LIGHTEN=1

WORKDIR /ragflow

RUN rm -f /etc/apt/apt.conf.d/docker-clean \
Expand Down Expand Up @@ -43,7 +45,11 @@ RUN cd web && npm i --force && npm run build
COPY pyproject.toml poetry.toml poetry.lock ./

RUN --mount=type=cache,target=/root/.cache/pypoetry,sharing=locked \
/root/.local/bin/poetry install --sync --no-cache --no-root
if [ "$LIGHTEN" -eq 0 ]; then \
/root/.local/bin/poetry install --sync --no-cache --no-root --with=full; \
else \
/root/.local/bin/poetry install --sync --no-cache --no-root; \
fi

# production stage
FROM base AS production
Expand Down Expand Up @@ -77,9 +83,6 @@ ENV PATH="${VIRTUAL_ENV}/bin:/root/.local/bin:${PATH}"
# Download nltk data
RUN python3 -m nltk.downloader wordnet punkt punkt_tab

# Copy models downloaded via download_deps.sh
# COPY det.onnx layout.laws.onnx layout.manual.onnx layout.onnx layout.paper.onnx ocr.res rec.onnx tsr.onnx updown_concat_xgb.model /ragflow/rag/res/deepdoc/

ENV PYTHONPATH=/ragflow/

COPY docker/entrypoint.sh ./entrypoint.sh
Expand Down
13 changes: 11 additions & 2 deletions docs/guides/develop/build_docker_image.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,22 @@ To build a RAGFlow Docker image from source code:

```bash
git clone https://github.com/infiniflow/ragflow.git
cd ragflow
```

### Build the Docker Image

Navigate to the `ragflow` directory where the Dockerfile and other necessary files are located. Now you can build the Docker image using the provided Dockerfile. The command below specifies which Dockerfile to use and tages the image with a name for reference purpose.

#### Build image `ragflow:dev-slim`
```bash
docker build -f Dockerfile.slim -t infiniflow/ragflow:dev-slim .
```
This image's size is about 1GB. It relies external LLM services since it doesn't contain embedding models.

#### Build image `ragflow:dev`
```bash
cd ragflow/
docker build -f Dockerfile.scratch -t infiniflow/ragflow:dev .
```
docker build -f Dockerfile -t infiniflow/ragflow:dev .
```
This image's size is about 11GB. It contains embedding models, and can inference via local CPU/GPU or external LLM services.
Loading

0 comments on commit af4b674

Please sign in to comment.