mirror of
https://github.com/open-webui/pipelines
synced 2025-05-12 08:30:43 +00:00
Merge pull request #300 from chemwolf6922/add-minimum-docker-build
Add minimum docker build
This commit is contained in:
commit
6cdac4f4d1
@ -1,2 +1,11 @@
|
|||||||
.venv
|
.venv
|
||||||
.env
|
.env
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
.github
|
||||||
|
Dockerfile
|
||||||
|
examples
|
||||||
|
docs
|
||||||
|
*.md
|
||||||
|
dev.sh
|
||||||
|
dev-docker.sh
|
||||||
|
19
.github/workflows/docker-build.yaml
vendored
19
.github/workflows/docker-build.yaml
vendored
@ -24,6 +24,16 @@ jobs:
|
|||||||
build_args: |
|
build_args: |
|
||||||
USE_CUDA=true
|
USE_CUDA=true
|
||||||
|
|
||||||
|
build-minimum-image:
|
||||||
|
uses: ./.github/workflows/build-docker-image.yaml
|
||||||
|
with:
|
||||||
|
image_name: ${{ github.repository }}
|
||||||
|
cache_id: minimum
|
||||||
|
image_tag: type=raw,enable=${{ github.ref == 'refs/heads/main' }},prefix=,suffix=,value=minimum
|
||||||
|
extract_flavor: suffix=-minimum,onlatest=true
|
||||||
|
build_args: |
|
||||||
|
MINIMUM_BUILD=true
|
||||||
|
|
||||||
merge-main-images:
|
merge-main-images:
|
||||||
uses: ./.github/workflows/merge-docker-images.yaml
|
uses: ./.github/workflows/merge-docker-images.yaml
|
||||||
needs: [build-main-image]
|
needs: [build-main-image]
|
||||||
@ -39,3 +49,12 @@ jobs:
|
|||||||
cache_id: cuda
|
cache_id: cuda
|
||||||
extract_flavor: suffix=-cuda,onlatest=true
|
extract_flavor: suffix=-cuda,onlatest=true
|
||||||
extract_tags: type=raw,enable=${{ github.ref == 'refs/heads/main' }},prefix=,suffix=,value=cuda
|
extract_tags: type=raw,enable=${{ github.ref == 'refs/heads/main' }},prefix=,suffix=,value=cuda
|
||||||
|
|
||||||
|
merge-minimum-images:
|
||||||
|
uses: ./.github/workflows/merge-docker-images.yaml
|
||||||
|
needs: [build-minimum-image]
|
||||||
|
with:
|
||||||
|
image_name: ${{ github.repository }}
|
||||||
|
cache_id: minimum
|
||||||
|
extract_flavor: suffix=-minimum,onlatest=true
|
||||||
|
extract_tags: type=raw,enable=${{ github.ref == 'refs/heads/main' }},prefix=,suffix=,value=minimum
|
||||||
|
19
Dockerfile
19
Dockerfile
@ -1,6 +1,7 @@
|
|||||||
FROM python:3.11-slim-bookworm AS base
|
FROM python:3.11-slim-bookworm AS base
|
||||||
|
|
||||||
# Use args
|
# Use args
|
||||||
|
ARG MINIMUM_BUILD
|
||||||
ARG USE_CUDA
|
ARG USE_CUDA
|
||||||
ARG USE_CUDA_VER
|
ARG USE_CUDA_VER
|
||||||
|
|
||||||
@ -8,11 +9,12 @@ ARG USE_CUDA_VER
|
|||||||
ENV ENV=prod \
|
ENV ENV=prod \
|
||||||
PORT=9099 \
|
PORT=9099 \
|
||||||
# pass build args to the build
|
# pass build args to the build
|
||||||
|
MINIMUM_BUILD=${MINIMUM_BUILD} \
|
||||||
USE_CUDA_DOCKER=${USE_CUDA} \
|
USE_CUDA_DOCKER=${USE_CUDA} \
|
||||||
USE_CUDA_DOCKER_VER=${USE_CUDA_VER}
|
USE_CUDA_DOCKER_VER=${USE_CUDA_VER}
|
||||||
|
|
||||||
|
# Install GCC and build tools.
|
||||||
# Install GCC and build tools
|
# These are kept in the final image to enable installing packages on the fly.
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y gcc build-essential curl git && \
|
apt-get install -y gcc build-essential curl git && \
|
||||||
apt-get clean && \
|
apt-get clean && \
|
||||||
@ -22,13 +24,20 @@ WORKDIR /app
|
|||||||
|
|
||||||
# Install Python dependencies
|
# Install Python dependencies
|
||||||
COPY ./requirements.txt .
|
COPY ./requirements.txt .
|
||||||
RUN pip3 install uv && \
|
COPY ./requirements-minimum.txt .
|
||||||
if [ "$USE_CUDA" = "true" ]; then \
|
RUN pip3 install uv
|
||||||
|
RUN if [ "$MINIMUM_BUILD" != "true" ]; then \
|
||||||
|
if [ "$USE_CUDA_DOCKER" = "true" ]; then \
|
||||||
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/$USE_CUDA_DOCKER_VER --no-cache-dir; \
|
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/$USE_CUDA_DOCKER_VER --no-cache-dir; \
|
||||||
else \
|
else \
|
||||||
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu --no-cache-dir; \
|
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu --no-cache-dir; \
|
||||||
|
fi \
|
||||||
|
fi
|
||||||
|
RUN if [ "$MINIMUM_BUILD" = "true" ]; then \
|
||||||
|
uv pip install --system -r requirements-minimum.txt --no-cache-dir; \
|
||||||
|
else \
|
||||||
|
uv pip install --system -r requirements.txt --no-cache-dir; \
|
||||||
fi
|
fi
|
||||||
RUN uv pip install --system -r requirements.txt --no-cache-dir
|
|
||||||
|
|
||||||
# Copy the application code
|
# Copy the application code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="#"><img src="./header.png" alt="Pipelines Logo"></a>
|
<a href="#"><img src="./docs/images/header.png" alt="Pipelines Logo"></a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
# Pipelines: UI-Agnostic OpenAI API Plugin Framework
|
# Pipelines: UI-Agnostic OpenAI API Plugin Framework
|
||||||
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |
15
requirements-minimum.txt
Normal file
15
requirements-minimum.txt
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
fastapi==0.111.0
|
||||||
|
uvicorn[standard]==0.22.0
|
||||||
|
pydantic==2.7.1
|
||||||
|
python-multipart==0.0.9
|
||||||
|
python-socketio
|
||||||
|
grpcio
|
||||||
|
|
||||||
|
passlib==1.7.4
|
||||||
|
passlib[bcrypt]
|
||||||
|
PyJWT[crypto]
|
||||||
|
|
||||||
|
requests==2.32.2
|
||||||
|
aiohttp==3.9.5
|
||||||
|
httpx
|
||||||
|
|
Loading…
Reference in New Issue
Block a user