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:
commit
0a0d1d9d20
|
|
@ -1,2 +1,2 @@
|
||||||
Branch: invoice-update
|
Branch: main
|
||||||
Commit: 50538bb64faa7f46d643ed60b9f0f272d5624a39
|
Commit: 895342a8ba976caa41f4b5b9fdec1c684e47dc5d
|
||||||
|
|
|
||||||
13
Dockerfile
13
Dockerfile
|
|
@ -15,7 +15,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
curl \
|
curl \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& 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 pyproject.toml ./
|
||||||
COPY README.md ./
|
COPY README.md ./
|
||||||
|
|
||||||
|
|
@ -26,8 +33,8 @@ COPY app ./app
|
||||||
# Copy git info metadata if generated on host
|
# Copy git info metadata if generated on host
|
||||||
COPY .git_api_info* /app/.git_api_info
|
COPY .git_api_info* /app/.git_api_info
|
||||||
|
|
||||||
# Install project and CLI scripts into PATH
|
# Install project and CLI scripts into system PATH using persistent BuildKit cache
|
||||||
RUN pip install --no-cache-dir -e .
|
RUN --mount=type=cache,target=/root/.cache/uv uv pip install --system -e .
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue