fd1e5df655
this is useful if you need to run docker with sudo because you're not in docker group
61 行
1.6 KiB
Makefile
61 行
1.6 KiB
Makefile
DOCKER := docker
|
|
DOCKERC := docker-compose
|
|
PORT := 8000
|
|
VENV := venv
|
|
CONFIG := dev_config.py
|
|
PY := python
|
|
OWNER := ${USER}
|
|
|
|
docker-build:
|
|
$(DOCKERC) build \
|
|
--no-cache \
|
|
--build-arg=hostgid=$(shell id -g) \
|
|
--build-arg=hostuid=$(shell id -u) \
|
|
--build-arg=audiogid=$(shell cat /etc/group | grep audio | awk -F: '{print $3}')
|
|
|
|
docker-build-liquidsoap:
|
|
$(DOCKER) pull savonet/liquidsoap:main
|
|
$(DOCKERC) build \
|
|
--no-cache \
|
|
--build-arg=audiogid=$(shell cat /etc/group | grep audio | awk -F: '{print $3}') \
|
|
liquidsoap
|
|
|
|
docker-build-techrec:
|
|
$(DOCKERC) build \
|
|
--no-cache \
|
|
--build-arg=hostgid=$(shell id -g ${OWNER}) \
|
|
--build-arg=hostuid=$(shell id -u ${OWNER}) \
|
|
techrec
|
|
|
|
docker-stop:
|
|
$(DOCKERC) down -v
|
|
|
|
docker-run:
|
|
$(DOCKERC) run --rm --service-ports techrec
|
|
|
|
docker-shell-techrec:
|
|
$(eval CONTAINER = $(shell docker ps|grep techrec_run|awk '{print $$12}'))
|
|
$(DOCKER) exec -ti $(CONTAINER) bash
|
|
|
|
docker-shell-storage:
|
|
$(DOCKERC) exec storage bash
|
|
|
|
docker-shell-liquidsoap:
|
|
$(eval CONTAINER = $(shell docker ps|grep liquidsoap|awk '{print $$12}'))
|
|
$(DOCKER) exec -ti $(CONTAINER) bash
|
|
|
|
docker-logs-storage:
|
|
$(DOCKERC) logs -f storage
|
|
|
|
docker-logs-liquidsoap:
|
|
$(DOCKERC) logs -f liquidsoap
|
|
|
|
local-install:
|
|
$(PY) -m venv $(VENV)
|
|
./$(VENV)/bin/pip install -e .
|
|
|
|
local-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 docker-logs-storage docker-logs-liquidsoap local-install local-serve
|