Skip to content

Commit c999691

Browse files
committed
unify
1 parent f776828 commit c999691

File tree

4 files changed

+41
-23
lines changed

4 files changed

+41
-23
lines changed

scripts/erd/Dockerfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
#
99

1010
ARG PYTHON_VERSION="3.11.9"
11+
ARG UV_VERSION="0.4"
12+
FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build
13+
# we docker image is built based on debian
1114
FROM python:${PYTHON_VERSION}-slim-bookworm AS base
1215

1316
RUN apt-get update \
@@ -22,13 +25,14 @@ RUN apt-get update \
2225
&& rm -rf /var/lib/apt/lists/* \
2326
&& apt-get clean
2427

28+
# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv
29+
COPY --from=uv_build /uv /uvx /bin/
2530

26-
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \
27-
pip install --upgrade \
28-
pip~=24.0 \
31+
RUN --mount=type=cache,target=/root/.cache/uv \
32+
uv pip install --upgrade \
2933
wheel \
3034
setuptools
3135

3236
COPY requirements.txt .
33-
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \
34-
pip install -r requirements.txt
37+
RUN --mount=type=cache,target=/root/.cache/uv \
38+
uv pip install -r requirements.txt
Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
11
# syntax=docker/dockerfile:1
2+
ARG UV_VERSION="0.4"
3+
FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build
4+
# we docker image is built based on debian
25
FROM python:3.11.9-buster
36

47
RUN curl https://rclone.org/install.sh | bash && \
58
rclone --version
69

10+
# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv
11+
COPY --from=uv_build /uv /uvx /bin/
12+
713
WORKDIR /scripts
814

915
COPY packages/postgres-database postgres-database
10-
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \
11-
cd postgres-database && pip install .
16+
RUN --mount=type=cache,target=/root/.cache/uv \
17+
cd postgres-database && uv pip install .
1218

1319
COPY packages/settings-library settings-library
14-
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \
15-
cd settings-library && pip install .
20+
RUN --mount=type=cache,target=/root/.cache/uv \
21+
cd settings-library && uv pip install .
1622

1723
COPY scripts/maintenance/migrate_project/requirements.txt /scripts/requirements.txt
18-
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \
19-
pip install -r /scripts/requirements.txt
24+
RUN --mount=type=cache,target=/root/.cache/uv \
25+
uv pip install -r /scripts/requirements.txt
2026

2127
COPY scripts/maintenance/migrate_project/src/*.py /scripts/

scripts/openapi/oas_resolver/Dockerfile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# Usage:
33
# docker build . -t oas_resolver
44
# docker run -v /path/to/api:/input -v /path/to/compiled/file:/output oas_resolver /input/path/to/openapi.yaml /output/output_file.yaml
5+
ARG UV_VERSION="0.4"
6+
FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build
7+
# we docker image is built based on debian
58
FROM python:3.6-alpine
69

710
LABEL maintainer=sanderegg
@@ -11,16 +14,16 @@ VOLUME [ "/output" ]
1114

1215
WORKDIR /src
1316

17+
# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv
18+
COPY --from=uv_build /uv /uvx /bin/
19+
1420
# update pip
15-
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \
16-
pip install --upgrade \
17-
pip~=24.0 \
21+
RUN --mount=type=cache,target=/root/.cache/uv \
22+
uv pip install --upgrade \
1823
wheel \
1924
setuptools
2025

21-
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \
22-
pip install prance && \
23-
pip install click &&\
24-
pip install openapi_spec_validator
26+
RUN --mount=type=cache,target=/root/.cache/uv \
27+
uv pip install prance click openapi_spec_validator
2528

2629
ENTRYPOINT [ "prance", "compile" , "--backend=openapi-spec-validator"]

scripts/pydeps-docker/Dockerfile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
#
1010
#
1111
ARG PYTHON_VERSION="3.11.9"
12+
ARG UV_VERSION="0.4"
13+
FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv_build
14+
# we docker image is built based on debian
1215
FROM python:${PYTHON_VERSION}-slim-bookworm AS base
1316

1417

@@ -23,18 +26,20 @@ RUN apt-get update \
2326
&& rm -rf /var/lib/apt/lists/* \
2427
&& apt-get clean
2528

29+
# install UV https://docs.astral.sh/uv/guides/integration/docker/#installing-uv
30+
COPY --from=uv_build /uv /uvx /bin/
31+
2632
ARG HOME_DIR
2733
RUN mkdir -p ${HOME_DIR}
2834
COPY .pydeps ${HOME_DIR}/.pydeps
2935

30-
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \
31-
pip install --upgrade \
32-
pip~=24.0 \
36+
RUN --mount=type=cache,target=/root/.cache/uv \
37+
uv pip install --upgrade \
3338
wheel \
3439
setuptools
3540

3641

3742
# devenv
38-
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip \
39-
pip install \
43+
RUN --mount=type=cache,target=/root/.cache/uv \
44+
uv pip install \
4045
pydeps

0 commit comments

Comments
 (0)