-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (42 loc) · 1.55 KB
/
Makefile
File metadata and controls
60 lines (42 loc) · 1.55 KB
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
.PHONY: build up down restart logs shell django-shell test migrate makemigrations static clean help
# Default target
.DEFAULT_GOAL := help
build: ## Build the Docker images
docker compose build
up: ## Start the application
docker compose up
up-d: ## Start the application in detached mode
docker compose up -d
down: ## Stop the application
docker compose down
restart: down up ## Restart the application
logs: ## View application logs
docker compose logs -f
shell: ## Access the web container's shell
docker compose exec web /bin/bash
django-shell: ## Access Django's Python shell
docker compose exec web python manage.py shell
test: ## Run Django tests
docker compose exec web python manage.py test
migrate: ## Apply database migrations
docker compose exec web python manage.py migrate
makemigrations: ## Create new database migrations
docker compose exec web python manage.py makemigrations
static: ## Collect static files
docker compose exec web python manage.py collectstatic --noinput
clean: ## Remove all containers, volumes, and images
docker compose down -v --rmi all
ps: ## Show running containers
docker compose ps
twbuild:
docker compose exec web npm i
docker compose exec web python manage.py tailwind install
docker compose exec web python manage.py tailwind build
docker compose restart
twstart:
docker compose exec web python manage.py tailwind start
help: ## Display this help message
@echo "Usage: make [target]"
@echo ""
@echo "Targets:"
@awk -F ':|##' '/^[^\t].+?:.*?##/ { printf " %-20s %s\n", $$1, $$NF }' $(MAKEFILE_LIST)