-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
51 lines (36 loc) · 1.19 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
.PHONY: all build start stop restart clean bash log migrations migrate makemessages compilemessages collectstatic cachetable superuser
# TODO
#CONTAINER=$(basename `pwd` | sed "s/[^[:alnum:]]//g")
CONTAINER=djangoinit
# https://docs.docker.com/compose/reference/build/
build:
docker-compose build --parallel
# --force-rm
# --no-cache
# https://docs.docker.com/engine/reference/commandline/exec/
bash:
docker exec -it ${CONTAINER} /bin/bash
clean:
find . -type f -name '*.py[co]' -delete -o -type d -name __pycache__ -delete
log:
docker-compose logs -f
start:
docker-compose up -d --remove-orphans
stop:
docker-compose down
restart:
docker-compose down && docker-compose up -d
migrations:
docker exec -it ${CONTAINER} python manage.py makemigrations
migrate:
docker exec -it ${CONTAINER} python manage.py migrate
messages:
docker exec -it ${CONTAINER} python manage.py makemessages -f venv/
compilemessages:
docker exec -it ${CONTAINER}} python manage.py compilemessages
collectstatic:
docker exec -it ${CONTAINER} python manage.py collectstatic
cachetable:
docker exec -it ${CONTAINER} python manage.py createcachetable
superuser:
docker exec -it ${CONTAINER} python manage.py createsuperuser