Compare commits

...

2 commits

Author SHA1 Message Date
bb8e4cdbfa
Generate first empty file at container startup 2021-09-15 21:53:57 +02:00
628e4d3d55
Enhance Makefile 2021-09-15 21:53:30 +02:00
4 changed files with 22 additions and 4 deletions

1
.gitignore vendored
View file

@ -6,3 +6,4 @@ dist/
rec/ rec/
*.egg-info/ *.egg-info/
/venv /venv
/docker/output/*

View file

@ -27,7 +27,7 @@ docker-build-techrec:
techrec techrec
docker-stop: docker-stop:
$(DOCKERC) down $(DOCKERC) down -v
docker-run: docker-run:
$(DOCKERC) run --rm --service-ports techrec $(DOCKERC) run --rm --service-ports techrec
@ -43,6 +43,12 @@ docker-shell-liquidsoap:
$(eval CONTAINER = $(shell docker ps|grep liquidsoap|awk '{print $$12}')) $(eval CONTAINER = $(shell docker ps|grep liquidsoap|awk '{print $$12}'))
$(DOCKER) exec -ti $(CONTAINER) bash $(DOCKER) exec -ti $(CONTAINER) bash
docker-logs-storage:
$(DOCKERC) logs -f storage
docker-logs-liquidsoap:
$(DOCKERC) logs -f liquidsoap
local-install: local-install:
$(PY) -m venv $(VENV) $(PY) -m venv $(VENV)
./$(VENV)/bin/pip install -e . ./$(VENV)/bin/pip install -e .
@ -51,4 +57,4 @@ local-serve:
env TECHREC_CONFIG=$(CONFIG) ./$(VENV)/bin/techrec -vv serve env TECHREC_CONFIG=$(CONFIG) ./$(VENV)/bin/techrec -vv serve
.PHONY: docker-build docker-build-liquidsoap docker-build-techrec docker-stop docker-run docker-shell-techrec docker-shell-storage docker-shell-liquidsoap local-install local-serve .PHONY: docker-build docker-build-liquidsoap docker-build-techrec docker-stop docker-run docker-shell-techrec docker-shell-storage docker-shell-liquidsoap docker-logs-storage docker-logs-liquidsoap local-install local-serve

View file

@ -7,11 +7,11 @@ services:
dockerfile: docker/Dockerfile.liquidsoap dockerfile: docker/Dockerfile.liquidsoap
volumes: volumes:
- ./docker/run.liq:/run.liq - ./docker/run.liq:/run.liq
- ./docker/ror.sh:/ror.sh - ./docker/run.sh:/run.sh
- rec:/rec - rec:/rec
devices: devices:
- /dev/snd:/dev/snd - /dev/snd:/dev/snd
entrypoint: /run.liq entrypoint: /run.sh
depends_on: depends_on:
- storageprepare - storageprepare

11
docker/run.sh Executable file
View file

@ -0,0 +1,11 @@
#!/bin/bash
set -xueo pipefail
FILEPATH="/rec/ror/$(date +%Y-%m)/$(date +%d)/rec-$(date +%Y-%m-%d-%H)-00-00.mp3"
mkdir -p $(dirname ${FILEPATH})
if ! [[ -f ${FILEPATH} ]]; then
ffmpeg -f lavfi -i anullsrc=r=11025:cl=mono -t 3600 -acodec mp3 ${FILEPATH}
fi
/run.liq