Skip to content

Commit

Permalink
[dist] Update Dockerfile.
Browse files Browse the repository at this point in the history
  • Loading branch information
frafra committed Feb 28, 2025
1 parent e9d37c6 commit 8fc5c98
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
FROM ubuntu:latest
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS builder

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

RUN apt-get update && apt-get install -y python3 python3-pip libgl1-mesa-glx libglib2.0-0
WORKDIR /app
RUN --mount=type=cache,target=/root/.cache/uv \
--mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync --frozen --no-install-project --no-dev
ADD . /app
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev && \
uv pip install .

RUN pip3 install dvr-scan[opencv]
FROM python:3.13-slim-bookworm

RUN --mount=target=/var/lib/apt/lists,type=cache,sharing=locked \
--mount=target=/var/cache/apt,type=cache,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean && \
apt-get update && apt-get install --no-install-recommends -yq libgl1-mesa-glx libglib2.0-0

COPY --from=builder --chown=app:app /app /app
ENV PATH="/app/.venv/bin:$PATH"

WORKDIR /video/

Expand Down

0 comments on commit 8fc5c98

Please sign in to comment.