-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
31 lines (21 loc) · 1.31 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Taken originally from: https://github.com/adriencaccia/vscode-flask-debug
.PHONY: help
.DEFAULT_GOAL := help
help:
@grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}{printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
## Build tools
install: ## setup the flask Docker container, install the requirements...
docker-compose build
clean: ## Clean __pycache__ files
py3clean .
rename: ## Renames the micro-service (see git diff to review the changes afterwards), e.g make rename FROM=service_name TO=new_name
./rename_service.sh $(FROM) $(TO)
## Start the Dockerized flask application in local environment
gunicorn: ## gunicorn and hot-reload
docker-compose run --rm -e VSCODE_DEBUG_MODE=False --service-ports service_name gunicorn --config "src/config/gunicorn_conf.py" "src.app:app"
gunicorndebug: ## gunicorn, hot-reload and VS Code debugger
docker-compose run --rm -e VSCODE_DEBUG_MODE=True --service-ports service_name gunicorn --config "src/config/gunicorn_conf.py" "src.app:app"
flask: ## flask and hot-reload
docker-compose run --rm -e VSCODE_DEBUG_MODE=False --service-ports service_name flask run
flaskdebug: ## flask, hot-reload and VS Code debugger
docker-compose run --rm -e VSCODE_DEBUG_MODE=True --service-ports service_name flask run