-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (22 loc) · 1.03 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
32
33
34
default: help
run: export FLASK_APP = flaskapp:app ## Run autoclassweb (flask app) on port 5000
run: export FLASK_DEBUG = 1
run:
flask run
.PHONY: run
run-gunicorn: ## Run autoclassweb with gunicorn (port 5000)
@test "${CONDA_DEFAULT_ENV}" = "autoclassweb" && echo "Conda env ${CONDA_DEFAULT_ENV} found" || { echo "not OK"; exit 1; }
gunicorn --config gunicorn.py flaskapp:app
.PHONY: run-gunicorn
docker-build: ## Build Docker image
docker build . -t autoclassweb
.PHONY: docker-build
docker-run: ## Run autoclassweb + gunicorn with Docker container (port 5000)
docker run --rm --name autoclassweb -p 5000:5000 -v ${PWD}/config:/app/config -v ${PWD}/logs:/app/logs -v ${PWD}/results:/app/results autoclassweb:latest gunicorn --config /app/gunicorn.py flaskapp:app
.PHONY: docker-run
docker-clean: ## Clean Docker images
docker image prune --all --force
.PHONY: docker-clean
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: help