generated from briancaffey/flask-redis-ecs-terraform
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
61 lines (49 loc) · 1.43 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# docker-compose
# start the backend services (flask, celery, celerybeat, redis-stack)
docker-compose:
@docker-compose up --build
# start the client
nuxt:
@cd client && npm i && npm run dev
# for local development if not using docker-compose to stat the backend services
# check versions of locally installed tools
check:
@docker -v; echo
@docker-compose -v; echo
@python3 --version; echo
@echo Node `node -v`; echo
# stand up only redis stack
redis-stack-up:
@docker-compose -f redis-stack.yml up
# install dependencies in a python virtual environment
install_dev:
@rm -rf app/.env
@python3 -m venv app/.env
@. app/.env/bin/activate
@python3 -m pip install --upgrade pip
@pip install -r app/requirements.txt
@pip install -r app/requirements_dev.txt
# delete the python virtual environment
clean:
@rm -rf .env
# start the flask app (api and websockets)
flask:
@. app/.env/bin/activate
@cd app && gunicorn -k geventwebsocket.gunicorn.workers.GeventWebSocketWorker -w 1 wsgi:app --reload
# start the celery worker
celery:
@. app/.env/bin/activate
@cd app && celery --app app.celery worker --loglevel=info
# start the celerybeat process
celerybeat:
@. app/.env/bin/activate
@cd app && celery --app app.celery beat --loglevel=info
# delete all keys from all redis databases
flushall:
@docker exec -it redis redis-cli flushall
# count lines of code
cloc:
cloc \
--exclude-dir=$$(tr '\n' ',' < .clocignore) \
--exclude-ext=json \
.