diff --git a/Dockerfile b/Dockerfile index 8750b4e..f9f4d54 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,7 @@ COPY . /src/techrec RUN groupadd -g ${hostgid} techrec \ && useradd -g techrec -u ${hostuid} -m techrec \ && mkdir -p /src/techrec \ + && mkdir -p /src/db \ && chown -R techrec:techrec /src \ && apt-get -qq update \ && apt-get install -qq -y ffmpeg \ @@ -24,5 +25,8 @@ RUN python -m venv ./venv \ && ./venv/bin/python -m pip install wheel \ && ./venv/bin/python -m pip install -e ./techrec +VOLUME ["/src/db"] +EXPOSE 8000 + ENTRYPOINT ["/src/venv/bin/techrec"] CMD ["-vv", "serve"] diff --git a/docker-compose.yaml b/docker-compose.yaml index 77f5363..42923c5 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -37,6 +37,7 @@ services: - .:/src/techrec - rec:/rec - ./docker/output:/src/output + - db:/src/db ports: - 8000:8000 depends_on: @@ -45,3 +46,4 @@ services: volumes: rec: + db: diff --git a/docker/config.py b/docker/config.py index 9b2a57f..c137766 100644 --- a/docker/config.py +++ b/docker/config.py @@ -1,3 +1,4 @@ +DB_URI = "sqlite:////src/db/techrec.db" AUDIO_INPUT = "http://storage" # decomment this if you want to test with local audio source # AUDIO_INPUT = "/rec" diff --git a/techrec/db.py b/techrec/db.py index 9e2833e..93b6e8c 100644 --- a/techrec/db.py +++ b/techrec/db.py @@ -82,7 +82,8 @@ class RecDB: self.log = logging.getLogger(name=self.__class__.__name__) logging.getLogger("sqlalchemy.engine").setLevel(logging.FATAL) - logging.getLogger("sqlalchemy.engine.base.Engine").setLevel(logging.FATAL) + logging.getLogger( + "sqlalchemy.engine.base.Engine").setLevel(logging.FATAL) logging.getLogger("sqlalchemy.dialects").setLevel(logging.FATAL) logging.getLogger("sqlalchemy.pool").setLevel(logging.FATAL) logging.getLogger("sqlalchemy.orm").setLevel(logging.FATAL)