From e6ca66b2f23724b009085ee6c748a7d00905c13e Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Fri, 8 Aug 2025 10:45:39 -0600 Subject: [PATCH] Enable debug builds with dev reqs installed --- .github/workflows/pull_request.yml | 2 +- Makefile | 6 ++++++ docker/main/Dockerfile | 8 +++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 02fde5861..ebe107d3d 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -107,7 +107,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Build - run: make + run: make debug - name: Run mypy run: docker run --rm --entrypoint=python3 frigate:latest -u -m mypy --config-file frigate/mypy.ini frigate - name: Run tests diff --git a/Makefile b/Makefile index 1c4e137a1..2baac5aad 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,12 @@ local: version --tag frigate:latest \ --load +debug: version + docker buildx build --target=frigate --file docker/main/Dockerfile . \ + --build-arg DEBUG=true \ + --tag frigate:latest \ + --load + amd64: docker buildx build --target=frigate --file docker/main/Dockerfile . \ --tag $(IMAGE_REPO):$(VERSION)-$(COMMIT_HASH) \ diff --git a/docker/main/Dockerfile b/docker/main/Dockerfile index 7850e6c18..bdb272cc7 100644 --- a/docker/main/Dockerfile +++ b/docker/main/Dockerfile @@ -148,6 +148,7 @@ RUN --mount=type=bind,source=docker/main/install_s6_overlay.sh,target=/deps/inst FROM base AS wheels ARG DEBIAN_FRONTEND ARG TARGETARCH +ARG DEBUG=false # Use a separate container to build wheels to prevent build dependencies in final image RUN apt-get -qq update \ @@ -177,7 +178,12 @@ RUN wget -q https://bootstrap.pypa.io/get-pip.py -O get-pip.py \ && python3 get-pip.py "pip" COPY docker/main/requirements.txt /requirements.txt -RUN pip3 install -r /requirements.txt +COPY docker/main/requirements-dev.txt /requirements-dev.txt + +RUN pip3 install -r /requirements.txt && \ + if [ "$DEBUG" = "true" ]; then \ + pip3 install -r /requirements-dev.txt; \ + fi # Build pysqlite3 from source COPY docker/main/build_pysqlite3.sh /build_pysqlite3.sh