Skip to content

Commit dca86d6

Browse files
committed
[dist] Update Dockerfile
1 parent e9d37c6 commit dca86d6

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

Dockerfile

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1-
FROM ubuntu:latest
1+
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS builder
22

3-
# Without this, some deps try to reconfigure tzdata (default is UTC)
4-
ENV DEBIAN_FRONTEND=noninteractive
3+
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy
4+
ENV UV_PYTHON_DOWNLOADS=0
55

6-
RUN apt-get update && apt-get install -y python3 python3-pip libgl1-mesa-glx libglib2.0-0
6+
WORKDIR /app
7+
RUN --mount=type=cache,target=/root/.cache/uv \
8+
--mount=type=bind,source=uv.lock,target=uv.lock \
9+
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
10+
uv sync --frozen --no-install-project --no-dev
11+
ADD . /app
12+
RUN --mount=type=cache,target=/root/.cache/uv \
13+
uv sync --frozen --no-dev && \
14+
uv pip install .
715

8-
RUN pip3 install dvr-scan[opencv]
16+
FROM python:3.13-slim-bookworm
17+
18+
RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
19+
--mount=target=/var/cache/apt,type=cache,sharing=locked \
20+
rm -f /etc/apt/apt.conf.d/docker-clean && \
21+
apt-get update && apt-get install --no-install-recommends -yq libgl1-mesa-glx libglib2.0-0
22+
23+
COPY --from=builder --chown=app:app /app /app
24+
ENV PATH="/app/.venv/bin:$PATH"
925

1026
WORKDIR /video/
1127

0 commit comments

Comments
 (0)