mirror of
https://github.com/open-webui/pipelines
synced 2025-06-26 18:15:58 +00:00
chore: docker
This commit is contained in:
23
Dockerfile
23
Dockerfile
@@ -1,5 +1,17 @@
|
||||
FROM python:3.11-slim-bookworm as base
|
||||
|
||||
# Use args
|
||||
ARG USE_CUDA
|
||||
ARG USE_CUDA_VER
|
||||
|
||||
## Basis ##
|
||||
ENV ENV=prod \
|
||||
PORT=9099 \
|
||||
# pass build args to the build
|
||||
USE_CUDA_DOCKER=${USE_CUDA} \
|
||||
USE_CUDA_DOCKER_VER=${USE_CUDA_VER}
|
||||
|
||||
|
||||
# Install GCC and build tools
|
||||
RUN apt-get update && \
|
||||
apt-get install -y gcc build-essential && \
|
||||
@@ -11,8 +23,17 @@ COPY . /app
|
||||
WORKDIR /app
|
||||
|
||||
# Install Python dependencies
|
||||
RUN pip3 install --no-cache-dir -r requirements.txt
|
||||
RUN pip3 install uv && \
|
||||
if [ "$USE_CUDA" = "true" ]; then \
|
||||
# If you use CUDA the whisper and embedding model will be downloaded on first use
|
||||
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/$USE_CUDA_DOCKER_VER --no-cache-dir && \
|
||||
uv pip install --system -r requirements.txt --no-cache-dir \
|
||||
else \
|
||||
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu --no-cache-dir && \
|
||||
uv pip install --system -r requirements.txt --no-cache-dir \
|
||||
fi;
|
||||
|
||||
# Expose the port
|
||||
ENV HOST="0.0.0.0"
|
||||
ENV PORT="9099"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user