Refactors the Dockerfile to use an in-container setup script instead of commands being mashed into RUN statements.
DRYs out the repeated package lists, PyTorch package index URL determination etc.
Switches to using uv for installing Torch as well (it's faster!)
Adds a check that the functionality to pre-load whisper and embedding models actually works
This should have no effect for the end user other than a possibly slightly smaller image.
For developers, this is easier to maintainer.
For CI and builders, this is faster.
Testing & review
I checked that an image built with and without USE_OLLAMA works as before.
I didn't check the CUDA configuration, since I have no CUDA-enabled Docker hardware at hand right now.
Changelog Entry
Changed
Optimized Docker build a bit.
🔄 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/2016
**Author:** [@akx](https://github.com/akx)
**Created:** 5/6/2024
**Status:** ❌ Closed
**Base:** `dev` ← **Head:** `docker-setup-cleanup`
---
### 📝 Commits (1)
- [`fc20b40`](https://github.com/open-webui/open-webui/commit/fc20b40019f679f7a5be19ab4e9b2cc396d707fa) fix: DRY + speed up docker build
### 📊 Changes
**2 files changed** (+40 additions, -39 deletions)
<details>
<summary>View changed files</summary>
📝 `Dockerfile` (+3 -39)
➕ `backend/docker_setup.sh` (+37 -0)
</details>
### 📄 Description
## Description
This PR:
* Refactors the Dockerfile to use an in-container setup script instead of commands being mashed into `RUN` statements.
* DRYs out the repeated package lists, PyTorch package index URL determination etc.
* Switches to using `uv` for installing Torch as well (it's faster!)
* Adds a check that the functionality to pre-load whisper and embedding models actually works
This should have no effect for the end user other than a possibly slightly smaller image.
For developers, this is easier to maintainer.
For CI and builders, this is faster.
## Testing & review
I checked that an image built with and without `USE_OLLAMA` works as before.
I didn't check the CUDA configuration, since I have no CUDA-enabled Docker hardware at hand right now.
---
### Changelog Entry
### Changed
- Optimized Docker build a bit.
---
<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/2016
Author: @akx
Created: 5/6/2024
Status: ❌ Closed
Base:
dev← Head:docker-setup-cleanup📝 Commits (1)
fc20b40fix: DRY + speed up docker build📊 Changes
2 files changed (+40 additions, -39 deletions)
View changed files
📝
Dockerfile(+3 -39)➕
backend/docker_setup.sh(+37 -0)📄 Description
Description
This PR:
RUNstatements.uvfor installing Torch as well (it's faster!)This should have no effect for the end user other than a possibly slightly smaller image.
For developers, this is easier to maintainer.
For CI and builders, this is faster.
Testing & review
I checked that an image built with and without
USE_OLLAMAworks as before.I didn't check the CUDA configuration, since I have no CUDA-enabled Docker hardware at hand right now.
Changelog Entry
Changed
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.