Use dedicated db volume to avoid stale files

This commit is contained in:
Blallo 2021-09-20 22:52:27 +02:00
parent 51fd340cd2
commit 59d84eafe2
No known key found for this signature in database
GPG key ID: 0CBE577C9B72DC3F
4 changed files with 9 additions and 1 deletions

View file

@ -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"]

View file

@ -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:

View file

@ -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"

View file

@ -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)