Merge pull request 'build(docker): speed up builds with uv package manager and BuildKit cache' (#22) from build/docker-uv-optimization into main

Reviewed-on: https://git.zedobject.local/AcuPedia/acupedia-api/pulls/22
Reviewed-by: Amit Salunke <amit@noreply.localhost>
This commit is contained in:
Amit Salunke 2026-11-02 04:48:25 +00:00
commit 0a0d1d9d20
2 changed files with 12 additions and 5 deletions

View File

@ -1,2 +1,2 @@
Branch: invoice-update
Commit: 50538bb64faa7f46d643ed60b9f0f272d5624a39
Branch: main
Commit: 895342a8ba976caa41f4b5b9fdec1c684e47dc5d

View File

@ -15,7 +15,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy pyproject.toml first for layer caching
# Prefer IPv4 over unrouted IPv6 in glibc to prevent PyPI connection timeouts
RUN echo "precedence ::ffff:0:0/96 100" >> /etc/gai.conf
# Use Astral's uv package manager for fast, parallel, cached installations
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
ENV UV_HTTP_TIMEOUT=300
# Copy pyproject.toml first
COPY pyproject.toml ./
COPY README.md ./
@ -26,8 +33,8 @@ COPY app ./app
# Copy git info metadata if generated on host
COPY .git_api_info* /app/.git_api_info
# Install project and CLI scripts into PATH
RUN pip install --no-cache-dir -e .
# Install project and CLI scripts into system PATH using persistent BuildKit cache
RUN --mount=type=cache,target=/root/.cache/uv uv pip install --system -e .
EXPOSE 8000