255fbb3 chore: optimize dockerfile order for caching
📊 Changes
2 files changed (+15 additions, -13 deletions)
View changed files
📝.dockerignore (+3 -0) 📝Dockerfile (+12 -13)
📄 Description
Rearranged the Dockerfile to speed up rebuilding. Basically moved all the dependencies ahead of the code copying, so it is more likely to be able to reuse cached layers unless the dependencies change.
=> CACHED [ollama-webui base 2/11] WORKDIR /app/backend 0.0s
=> CACHED [ollama-webui base 3/11] COPY ./backend/requirements.txt ./requirements.txt 0.0s
=> CACHED [ollama-webui base 4/11] RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu --no-cache-dir 0.0s
=> CACHED [ollama-webui base 5/11] RUN pip3 install -r requirements.txt --no-cache-dir 0.0s
=> CACHED [ollama-webui base 6/11] RUN apt-get update && apt-get install -y pandoc && rm -rf /var/lib/apt/lists/* 0.0s
=> CACHED [ollama-webui base 7/11] RUN mkdir -p /root/.cache/chroma/onnx_models/all-MiniLM-L6-v2 0.0s
=> CACHED [ollama-webui base 8/11] COPY --from=build /app/onnx.tar.gz /root/.cache/chroma/onnx_models/all-MiniLM-L6-v2 0.0s
=> CACHED [ollama-webui base 9/11] RUN cd /root/.cache/chroma/onnx_models/all-MiniLM-L6-v2 && tar -xzf onnx.tar.gz 0.0s
=> [ollama-webui base 10/11] COPY --from=build /app/build /app/build 0.2s
=> [ollama-webui base 11/11] COPY ./backend . 0.2s
=> [ollama-webui] exporting to image 1.8s
=> => exporting layers 1.7s
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/553
**Author:** [@baumandm](https://github.com/baumandm)
**Created:** 1/23/2024
**Status:** ✅ Merged
**Merged:** 1/23/2024
**Merged by:** [@tjbck](https://github.com/tjbck)
**Base:** `main` ← **Head:** `chore/fast-docker-builds`
---
### 📝 Commits (1)
- [`255fbb3`](https://github.com/open-webui/open-webui/commit/255fbb3c968d57c0c938ac8b31cd0ab3109d9325) chore: optimize dockerfile order for caching
### 📊 Changes
**2 files changed** (+15 additions, -13 deletions)
<details>
<summary>View changed files</summary>
📝 `.dockerignore` (+3 -0)
📝 `Dockerfile` (+12 -13)
</details>
### 📄 Description
Rearranged the Dockerfile to speed up rebuilding. Basically moved all the dependencies ahead of the code copying, so it is more likely to be able to reuse cached layers unless the dependencies change.
```
=> CACHED [ollama-webui base 2/11] WORKDIR /app/backend 0.0s
=> CACHED [ollama-webui base 3/11] COPY ./backend/requirements.txt ./requirements.txt 0.0s
=> CACHED [ollama-webui base 4/11] RUN pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu --no-cache-dir 0.0s
=> CACHED [ollama-webui base 5/11] RUN pip3 install -r requirements.txt --no-cache-dir 0.0s
=> CACHED [ollama-webui base 6/11] RUN apt-get update && apt-get install -y pandoc && rm -rf /var/lib/apt/lists/* 0.0s
=> CACHED [ollama-webui base 7/11] RUN mkdir -p /root/.cache/chroma/onnx_models/all-MiniLM-L6-v2 0.0s
=> CACHED [ollama-webui base 8/11] COPY --from=build /app/onnx.tar.gz /root/.cache/chroma/onnx_models/all-MiniLM-L6-v2 0.0s
=> CACHED [ollama-webui base 9/11] RUN cd /root/.cache/chroma/onnx_models/all-MiniLM-L6-v2 && tar -xzf onnx.tar.gz 0.0s
=> [ollama-webui base 10/11] COPY --from=build /app/build /app/build 0.2s
=> [ollama-webui base 11/11] COPY ./backend . 0.2s
=> [ollama-webui] exporting to image 1.8s
=> => exporting layers 1.7s
```
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/553
Author: @baumandm
Created: 1/23/2024
Status: ✅ Merged
Merged: 1/23/2024
Merged by: @tjbck
Base:
main← Head:chore/fast-docker-builds📝 Commits (1)
255fbb3chore: optimize dockerfile order for caching📊 Changes
2 files changed (+15 additions, -13 deletions)
View changed files
📝
.dockerignore(+3 -0)📝
Dockerfile(+12 -13)📄 Description
Rearranged the Dockerfile to speed up rebuilding. Basically moved all the dependencies ahead of the code copying, so it is more likely to be able to reuse cached layers unless the dependencies change.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.