diff --git a/docker/main/Dockerfile b/docker/main/Dockerfile index 42009e7c86..c1d44c2a96 100644 --- a/docker/main/Dockerfile +++ b/docker/main/Dockerfile @@ -183,10 +183,6 @@ COPY docker/main/requirements-dev.txt /requirements-dev.txt RUN pip3 install -r /requirements.txt -# Build pysqlite3 from source -COPY docker/main/build_pysqlite3.sh /build_pysqlite3.sh -RUN /build_pysqlite3.sh - COPY docker/main/requirements-wheels.txt /requirements-wheels.txt RUN pip3 wheel --wheel-dir=/wheels -r /requirements-wheels.txt && \ if [ "$DEBUG" = "true" ]; then \ diff --git a/docker/main/build_pysqlite3.sh b/docker/main/build_pysqlite3.sh deleted file mode 100755 index 14d0cde44c..0000000000 --- a/docker/main/build_pysqlite3.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -set -euxo pipefail - -SQLITE3_VERSION="3.46.1" -PYSQLITE3_VERSION="0.5.3" - -# Install libsqlite3-dev if not present (needed for some base images like NVIDIA TensorRT) -if ! dpkg -l | grep -q libsqlite3-dev; then - echo "Installing libsqlite3-dev for compilation..." - apt-get update && apt-get install -y libsqlite3-dev && rm -rf /var/lib/apt/lists/* -fi - -# Fetch the pre-built sqlite amalgamation instead of building from source -if [[ ! -d "sqlite" ]]; then - mkdir sqlite - cd sqlite - - # Download the pre-built amalgamation from sqlite.org - # For SQLite 3.46.1, the amalgamation version is 3460100 - SQLITE_AMALGAMATION_VERSION="3460100" - - wget https://www.sqlite.org/2024/sqlite-amalgamation-${SQLITE_AMALGAMATION_VERSION}.zip -O sqlite-amalgamation.zip - unzip sqlite-amalgamation.zip - mv sqlite-amalgamation-${SQLITE_AMALGAMATION_VERSION}/* . - rmdir sqlite-amalgamation-${SQLITE_AMALGAMATION_VERSION} - rm sqlite-amalgamation.zip - - cd ../ -fi - -# Grab the pysqlite3 source code. -if [[ ! -d "./pysqlite3" ]]; then - git clone https://github.com/coleifer/pysqlite3.git -fi - -cd pysqlite3/ -git checkout ${PYSQLITE3_VERSION} - -# Copy the sqlite3 source amalgamation into the pysqlite3 directory so we can -# create a self-contained extension module. -cp "../sqlite/sqlite3.c" ./ -cp "../sqlite/sqlite3.h" ./ - -# Create the wheel and put it in the /wheels dir. -sed -i "s|name='pysqlite3-binary'|name=PACKAGE_NAME|g" setup.py -python3 setup.py build_static -pip3 wheel . -w /wheels diff --git a/frigate/app.py b/frigate/app.py index f0c0b7f9b4..ec78d202eb 100644 --- a/frigate/app.py +++ b/frigate/app.py @@ -276,6 +276,7 @@ class FrigateApp: "auto_vacuum": "FULL", # Does not defragment database "cache_size": -512 * 1000, # 512MB of cache, "synchronous": "NORMAL", # Safe when using WAL https://www.sqlite.org/pragma.html#pragma_synchronous + "temp_store": "MEMORY", # Keep temp tables and indices in memory }, timeout=max( 60,