Use pre-built UI artifacts in Docker build for faster CI

- Make build_docker_database_image depend on ui_build job
- Attach workspace to get pre-built UI from ui_build
- Skip build_admin_ui.sh when UI is already built (check for index.html)
- Applies to both Dockerfile and Dockerfile.database

This gives us faster CI builds (UI builds in parallel with other jobs,
Docker just copies the result) while still including the full UI in the
Docker image.

https://claude.ai/code/session_01UeKmKn4x1ZedSYEvuXg1vz
This commit is contained in:
mateo-berri 2026-05-28 00:28:12 +00:00
parent 9cac0471ae
commit 0b699b92c0
No known key found for this signature in database
3 changed files with 16 additions and 4 deletions

View file

@ -2523,6 +2523,8 @@ jobs:
working_directory: ~/project
steps:
- checkout
- attach_workspace:
at: ~/project
- run:
name: Build Docker image
@ -2612,6 +2614,8 @@ workflows:
- auth_ui_unit_tests:
filters: *main_branches
- build_docker_database_image:
requires:
- ui_build
filters: *main_branches
- e2e_ui_testing:
filters: *main_branches

View file

@ -47,8 +47,12 @@ RUN uv sync --frozen --no-install-project --no-install-workspace --no-default-gr
# Copy full source tree
COPY . .
# Build Admin UI before final sync
RUN sed -i 's/\r$//' docker/build_admin_ui.sh && chmod +x docker/build_admin_ui.sh && ./docker/build_admin_ui.sh
# Build Admin UI before final sync (skip if pre-built UI exists from CI)
RUN if [ ! -f litellm/proxy/_experimental/out/index.html ]; then \
sed -i 's/\r$//' docker/build_admin_ui.sh && chmod +x docker/build_admin_ui.sh && ./docker/build_admin_ui.sh; \
else \
echo "Using pre-built Admin UI from CI"; \
fi
# Install project and workspace packages (fast - deps already cached)
RUN uv sync --frozen --no-default-groups --no-editable \

View file

@ -46,8 +46,12 @@ RUN uv sync --frozen --no-install-project --no-install-workspace --no-default-gr
# Copy full source tree
COPY . .
# Build Admin UI before final sync
RUN sed -i 's/\r$//' docker/build_admin_ui.sh && chmod +x docker/build_admin_ui.sh && ./docker/build_admin_ui.sh
# Build Admin UI before final sync (skip if pre-built UI exists from CI)
RUN if [ ! -f litellm/proxy/_experimental/out/index.html ]; then \
sed -i 's/\r$//' docker/build_admin_ui.sh && chmod +x docker/build_admin_ui.sh && ./docker/build_admin_ui.sh; \
else \
echo "Using pre-built Admin UI from CI"; \
fi
# Install project and workspace packages (fast - deps already cached)
RUN uv sync --frozen --no-default-groups --no-editable \