Skip to content

Commit 1122584

Browse files
committed
bump uv and use mounts more
1 parent 19fad62 commit 1122584

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

Dockerfile

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM rust:1.80-alpine3.20 AS accents_builder
1+
FROM rust:1.82-alpine3.20 AS accents_builder
22

33
WORKDIR /build
44

@@ -11,21 +11,22 @@ RUN : \
1111
FROM python:3.12-alpine3.20
1212

1313
ENV PYTHONUNBUFFERED=yes \
14-
PYTHONDONTWRITEBYTECODE=yes
14+
PYTHONDONTWRITEBYTECODE=yes \
15+
UV_LINK_MODE=copy
1516

1617
WORKDIR /code
1718

18-
COPY --from=ghcr.io/astral-sh/uv:0.4.0 /uv /bin/uv
19-
COPY uv.lock pyproject.toml .
20-
21-
RUN --mount=type=cache,target=/root/.cache/uv : \
22-
&& apk add --no-cache \
19+
RUN --mount=from=ghcr.io/astral-sh/uv:0.4.24,source=/uv,target=/bin/uv \
20+
--mount=type=cache,target=/root/.cache/uv \
21+
--mount=type=bind,source=uv.lock,target=uv.lock \
22+
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
23+
apk add --no-cache \
2324
# gif optimizer
2425
gifsicle \
2526
# Font for trocr
2627
ttf-dejavu \
27-
&& uv sync --frozen --no-dev --link-mode=copy \
28-
&& rm /bin/uv pyproject.toml uv.lock
28+
# export requirements from uv.lock since uv does not support sync withour venv
29+
&& uv export --frozen --format requirements-txt --no-dev --quiet | uv pip install --system -r -
2930

3031
COPY --from=accents_builder /build/target/release/sayit /usr/bin/sayit
3132

0 commit comments

Comments
 (0)