-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (38 loc) · 979 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
39
40
41
42
43
44
45
46
47
48
49
50
REGISTRY=ghcr.io/almazkun
IMAGE_NAME=django-chat
CONTAINER_NAME=django-chat-container
VERSION=0.0.1
lint:
@echo "Running lint..."
pipenv run ruff check --fix -e .
pipenv run black .
pipenv run djlint . --reformat
build:
docker build -t $(REGISTRY)/$(IMAGE_NAME):$(VERSION) .
docker tag $(REGISTRY)/$(IMAGE_NAME):$(VERSION) $(REGISTRY)/$(IMAGE_NAME):latest
push:
docker push $(REGISTRY)/$(IMAGE_NAME):$(VERSION)
docker push $(REGISTRY)/$(IMAGE_NAME):latest
run:
docker run \
-it \
--rm \
-d \
-p 8000:8000 \
--name $(CONTAINER_NAME) \
--env-file .env \
$(REGISTRY)/$(IMAGE_NAME):$(VERSION)
stop:
docker stop $(CONTAINER_NAME)
restart:
docker restart $(CONTAINER_NAME)
pull:
docker pull $(REGISTRY)/$(IMAGE_NAME):latest
logs:
docker logs $(CONTAINER_NAME) -f
migrate:
docker exec $(CONTAINER_NAME) python manage.py migrate
startdemo:
docker exec $(CONTAINER_NAME) python manage.py startdemo
runserver:
pipenv run python manage.py runserver