Use dedicated db volume to avoid stale files
This commit is contained in:
parent
51fd340cd2
commit
59d84eafe2
4 changed files with 9 additions and 1 deletions
|
@ -12,6 +12,7 @@ COPY . /src/techrec
|
||||||
RUN groupadd -g ${hostgid} techrec \
|
RUN groupadd -g ${hostgid} techrec \
|
||||||
&& useradd -g techrec -u ${hostuid} -m techrec \
|
&& useradd -g techrec -u ${hostuid} -m techrec \
|
||||||
&& mkdir -p /src/techrec \
|
&& mkdir -p /src/techrec \
|
||||||
|
&& mkdir -p /src/db \
|
||||||
&& chown -R techrec:techrec /src \
|
&& chown -R techrec:techrec /src \
|
||||||
&& apt-get -qq update \
|
&& apt-get -qq update \
|
||||||
&& apt-get install -qq -y ffmpeg \
|
&& 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 wheel \
|
||||||
&& ./venv/bin/python -m pip install -e ./techrec
|
&& ./venv/bin/python -m pip install -e ./techrec
|
||||||
|
|
||||||
|
VOLUME ["/src/db"]
|
||||||
|
EXPOSE 8000
|
||||||
|
|
||||||
ENTRYPOINT ["/src/venv/bin/techrec"]
|
ENTRYPOINT ["/src/venv/bin/techrec"]
|
||||||
CMD ["-vv", "serve"]
|
CMD ["-vv", "serve"]
|
||||||
|
|
|
@ -37,6 +37,7 @@ services:
|
||||||
- .:/src/techrec
|
- .:/src/techrec
|
||||||
- rec:/rec
|
- rec:/rec
|
||||||
- ./docker/output:/src/output
|
- ./docker/output:/src/output
|
||||||
|
- db:/src/db
|
||||||
ports:
|
ports:
|
||||||
- 8000:8000
|
- 8000:8000
|
||||||
depends_on:
|
depends_on:
|
||||||
|
@ -45,3 +46,4 @@ services:
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
rec:
|
rec:
|
||||||
|
db:
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
DB_URI = "sqlite:////src/db/techrec.db"
|
||||||
AUDIO_INPUT = "http://storage"
|
AUDIO_INPUT = "http://storage"
|
||||||
# decomment this if you want to test with local audio source
|
# decomment this if you want to test with local audio source
|
||||||
# AUDIO_INPUT = "/rec"
|
# AUDIO_INPUT = "/rec"
|
||||||
|
|
|
@ -82,7 +82,8 @@ class RecDB:
|
||||||
self.log = logging.getLogger(name=self.__class__.__name__)
|
self.log = logging.getLogger(name=self.__class__.__name__)
|
||||||
|
|
||||||
logging.getLogger("sqlalchemy.engine").setLevel(logging.FATAL)
|
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.dialects").setLevel(logging.FATAL)
|
||||||
logging.getLogger("sqlalchemy.pool").setLevel(logging.FATAL)
|
logging.getLogger("sqlalchemy.pool").setLevel(logging.FATAL)
|
||||||
logging.getLogger("sqlalchemy.orm").setLevel(logging.FATAL)
|
logging.getLogger("sqlalchemy.orm").setLevel(logging.FATAL)
|
||||||
|
|
Loading…
Reference in a new issue