diff --git a/docker/main/Dockerfile b/docker/main/Dockerfile index e35eac191..a4dd1921a 100644 --- a/docker/main/Dockerfile +++ b/docker/main/Dockerfile @@ -197,6 +197,8 @@ EXPOSE 8555/tcp 8555/udp # Configure logging to prepend timestamps, log to stdout, keep 0 archives and rotate on 10MB ENV S6_LOGGING_SCRIPT="T 1 n0 s10000000 T" +# Do not fail on long-running download scripts +ENV S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 ENTRYPOINT ["/init"] CMD [] diff --git a/docker/main/rootfs/etc/s6-overlay/s6-rc.d/download-models/dependencies.d/base b/docker/main/rootfs/etc/s6-overlay/s6-rc.d/download-models/dependencies.d/base new file mode 100644 index 000000000..e69de29bb diff --git a/docker/main/rootfs/etc/s6-overlay/s6-rc.d/download-models/run b/docker/main/rootfs/etc/s6-overlay/s6-rc.d/download-models/run new file mode 100755 index 000000000..4a7abe814 --- /dev/null +++ b/docker/main/rootfs/etc/s6-overlay/s6-rc.d/download-models/run @@ -0,0 +1,8 @@ +#!/command/with-contenv bash +# shellcheck shell=bash +# Download yolov8 models when DOWNLOAD_YOLOV8=1 environment variable is set + +set -o errexit -o nounset -o pipefail + +python3 /opt/frigate/frigate/util/download_models.py + diff --git a/docker/main/rootfs/etc/s6-overlay/s6-rc.d/download-models/timeout-up b/docker/main/rootfs/etc/s6-overlay/s6-rc.d/download-models/timeout-up new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/docker/main/rootfs/etc/s6-overlay/s6-rc.d/download-models/timeout-up @@ -0,0 +1 @@ +0 diff --git a/docker/main/rootfs/etc/s6-overlay/s6-rc.d/download-models/type b/docker/main/rootfs/etc/s6-overlay/s6-rc.d/download-models/type new file mode 100644 index 000000000..bdd22a185 --- /dev/null +++ b/docker/main/rootfs/etc/s6-overlay/s6-rc.d/download-models/type @@ -0,0 +1 @@ +oneshot diff --git a/docker/main/rootfs/etc/s6-overlay/s6-rc.d/download-models/up b/docker/main/rootfs/etc/s6-overlay/s6-rc.d/download-models/up new file mode 100644 index 000000000..8daf1e9de --- /dev/null +++ b/docker/main/rootfs/etc/s6-overlay/s6-rc.d/download-models/up @@ -0,0 +1 @@ +/etc/s6-overlay/s6-rc.d/download-models/run diff --git a/docker/main/rootfs/etc/s6-overlay/s6-rc.d/frigate/dependencies.d/download-models b/docker/main/rootfs/etc/s6-overlay/s6-rc.d/frigate/dependencies.d/download-models new file mode 100644 index 000000000..e69de29bb