@@ -13,6 +13,7 @@ RUN npm run build
13
13
14
14
# build python app
15
15
FROM python:3.12-bookworm AS python-builder
16
+ COPY --from=ghcr.io/astral-sh/uv:0.6.2 /uv /uvx /bin/
16
17
17
18
WORKDIR /app
18
19
@@ -28,26 +29,26 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
28
29
libzbar0 \
29
30
python3-gdal
30
31
31
- ENV POETRY_NO_INTERACTION=1 \
32
- POETRY_VIRTUALENVS_IN_PROJECT=1 \
33
- POETRY_VIRTUALENVS_CREATE=1 \
34
- POETRY_CACHE_DIR=/tmp/poetry_cache \
35
- POETRY_REQUESTS_TIMEOUT=600
32
+ ENV UV_LINK_MODE=copy \
33
+ UV_HTTP_TIMEOUT=300s
36
34
37
- COPY pyproject.toml poetry.lock ./
38
-
39
- RUN --mount=type=cache,target=$POETRY_CACHE_DIR python3 -m pip install --break-system-packages poetry setuptools \
40
- && python3 -m poetry install --only main --no-root --no-directory
35
+ RUN --mount=type=cache,target=/root/.cache/uv \
36
+ --mount=type=bind,source=uv.lock,target=uv.lock \
37
+ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
38
+ uv sync --frozen --no-install-project \
39
+ && uv pip install \
40
+ gdal[numpy]=="$(gdal-config --version).*" \
41
+ psycopg2
41
42
42
43
COPY sketch_map_tool sketch_map_tool
43
44
COPY data data
44
45
COPY config config
45
46
46
- RUN --mount=type=cache,target=$POETRY_CACHE_DIR python3 -m poetry install --only main --no- root --no-directory \
47
- && python3 -m poetry run python -m pip install \
48
- gdal[numpy]== "$(gdal-config --version).*" \
49
- psycopg2 \
50
- && python3 -m poetry run pybabel compile -d sketch_map_tool/translations
47
+ RUN --mount=type=cache,target=/ root/.cache/uv \
48
+ --mount=type=bind,source=uv.lock,target=uv.lock \
49
+ --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
50
+ uv sync --frozen --no-editable \
51
+ && uv run pybabel compile -d sketch_map_tool/translations
51
52
52
53
53
54
# final image
0 commit comments