mirror of
https://github.com/open-webui/pipelines
synced 2025-06-26 18:15:58 +00:00
fix(docker-build): refine start.sh for pre-install at docker build
This commit is contained in:
16
Dockerfile
16
Dockerfile
@@ -4,6 +4,8 @@ FROM python:3.11-slim-bookworm AS base
|
||||
ARG MINIMUM_BUILD
|
||||
ARG USE_CUDA
|
||||
ARG USE_CUDA_VER
|
||||
ARG PIPELINES_URLS
|
||||
ARG PIPELINES_REQUIREMENTS_PATH
|
||||
|
||||
## Basis ##
|
||||
ENV ENV=prod \
|
||||
@@ -39,11 +41,25 @@ RUN if [ "$MINIMUM_BUILD" = "true" ]; then \
|
||||
uv pip install --system -r requirements.txt --no-cache-dir; \
|
||||
fi
|
||||
|
||||
|
||||
# Layer on for other components
|
||||
FROM base AS app
|
||||
|
||||
ENV PIPELINES_URLS=${PIPELINES_URLS} \
|
||||
PIPELINES_REQUIREMENTS_PATH=${PIPELINES_REQUIREMENTS_PATH}
|
||||
|
||||
# Copy the application code
|
||||
COPY . .
|
||||
|
||||
# Run a docker command if either PIPELINES_URLS or PIPELINES_REQUIREMENTS_PATH is not empty
|
||||
RUN if [ -n "$PIPELINES_URLS" ] || [ -n "$PIPELINES_REQUIREMENTS_PATH" ]; then \
|
||||
echo "Running docker command with PIPELINES_URLS or PIPELINES_REQUIREMENTS_PATH"; \
|
||||
./start.sh --mode setup; \
|
||||
fi
|
||||
|
||||
# Expose the port
|
||||
ENV HOST="0.0.0.0"
|
||||
ENV PORT="9099"
|
||||
|
||||
# if we already installed the requirements on build, we can skip this step on run
|
||||
ENTRYPOINT [ "bash", "start.sh" ]
|
||||
|
||||
Reference in New Issue
Block a user