Newer
Older
web-services / Makefile
@Nicolas Thouvenin Nicolas Thouvenin on 10 Dec 1006 bytes add section for dev
.PHONY: help
.DEFAULT_GOAL := help

USER_ID = $(shell id -u)
GROUP_ID = $(shell id -g)

export UID = $(USER_ID)
export GID = $(GROUP_ID)

help:
	@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

shell: ## Open dockerized Bash terminal
	@docker-compose run --no-deps --rm shell

pycli: ## Open dockerized python command line interface
	@docker-compose run --no-deps --rm shell python3

python: ## Launch PYTHON daemon for one directory,  eg make daemon ./domains-classifier 
	WORKING_DIR="$(filter-out $@,$(MAKECMDGOALS))" docker-compose up --no-deps --force-recreate python

nodejs: ## Launch NODEJS daemon for one directory,  eg make daemon ./base-line 
	WORKING_DIR="$(filter-out $@,$(MAKECMDGOALS))" docker-compose up --no-deps --force-recreate nodejs

reset: ## Reset files permissions for all directory
	@docker-compose run --no-deps --rm shell bash -c "find /app -user daemon -exec chown ${UID}:${GID} {} \;"