-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
91 lines (77 loc) · 3.29 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
export COMPOSE_FILE=deployment/docker-compose.yml:deployment/docker-compose.override.yml
SHELL := /bin/bash
build:
@echo
@echo "------------------------------------------------------------------"
@echo "Building in production mode"
@echo "------------------------------------------------------------------"
@docker compose build
up:
@echo
@echo "------------------------------------------------------------------"
@echo "Running in production mode"
@echo "------------------------------------------------------------------"
@docker compose ${ARGS} up -d nginx django
dev:
@echo
@echo "------------------------------------------------------------------"
@echo "Running in dev mode"
@echo "------------------------------------------------------------------"
@docker compose ${ARGS} up -d dev redis worker
test:
@echo
@echo "------------------------------------------------------------------"
@echo "Running in test mode"
@echo "------------------------------------------------------------------"
@docker compose ${ARGS} up --no-recreate -d dev
serve:
@echo
@echo "------------------------------------------------------------------"
@echo "Execute webpack serve command"
@echo "------------------------------------------------------------------"
@docker compose ${ARGS} exec -T dev npm --prefix /home/web/django_project/frontend run serve
dev-shell:
@echo
@echo "------------------------------------------------------------------"
@echo "Execute webpack serve command"
@echo "------------------------------------------------------------------"
@docker compose ${ARGS} exec -ti dev /bin/bash
down:
@echo
@echo "------------------------------------------------------------------"
@echo "Removing production instance!!! "
@echo "------------------------------------------------------------------"
@docker compose ${ARGS} down
wait-db:
@docker compose ${ARGS} exec -T db su - postgres -c "until pg_isready; do sleep 5; done"
sleep:
@echo
@echo "------------------------------------------------------------------"
@echo "Sleep for 10 seconds"
@echo "------------------------------------------------------------------"
@sleep 10
@echo "Done"
migrate:
@echo
@echo "------------------------------------------------------------------"
@echo "Running migration"
@echo "------------------------------------------------------------------"
@docker compose ${ARGS} exec -T dev python manage.py migrate
npm-install:
@echo
@echo "------------------------------------------------------------------"
@echo "Install frontend dependencies"
@echo "------------------------------------------------------------------"
@docker compose ${ARGS} exec -T dev npm --prefix /home/web/django_project/frontend install
build-react:
@echo
@echo "------------------------------------------------------------------"
@echo "Execute webpack build command"
@echo "------------------------------------------------------------------"
@docker compose ${ARGS} exec -T dev npm --prefix /home/web/django_project/frontend run build
dev-runserver:
@echo
@echo "------------------------------------------------------------------"
@echo "Start django runserver in dev container"
@echo "------------------------------------------------------------------"
@docker compose $(ARGS) exec -T dev bash -c "nohup python manage.py runserver 0.0.0.0:8080 &"