-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (32 loc) · 991 Bytes
/
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
35
36
37
38
VENV = venv
VENV_BIN = $(VENV)/Scripts
# VENV_BIN = $(VENV)/bin
PYTHON = $(VENV_BIN)/python
PIP = $(VENV_BIN)/pip
# NOTE: Gunicorn is not supported on Windows
GUNICORN = $(VENV_BIN)/gunicorn
GUNICORN_PROD = $(GUNICORN) --workers 4 --bind 0.0.0.0:8000
# NOTE: Waitress is a fallback if Gunicorn is not available
WAITRESS = $(VENV_BIN)/waitress-serve
WAITRESS_PROD = $(WAITRESS) --listen=0.0.0.0:8000
WAITRESS_DEV = $(WAITRESS) --listen=*:8080
# NOTE: Flask development server is not intended for production use
FLASK_APP = service_journal.server_tools.app:create_app
FLASK = $(VENV_BIN)/flask run
FLASK_ENV = development
WEB_SERVER = $(FLASK)
export FLASK_APP
export FLASK_ENV
.PHONY: run clean setup
$(VENV_BIN)/activate: requirements.txt
python -m venv $(VENV)
$(PIP) install -r requirements.txt
setup: requirements.txt
$(PIP) install -r requirements.txt
clean:
rd /s /q $(VENV)
rd /s /q __pycache__
# rm -rf $(VENV)
# rm -rf __pycache__
run: $(VENV_BIN)/activate
$(WEB_SERVER)