-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
41 lines (31 loc) · 981 Bytes
/
makefile
File metadata and controls
41 lines (31 loc) · 981 Bytes
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
# Define variables
DOCKER_COMPOSE := docker-compose
DOCKER_BUILD := docker build
PROJECT_NAME := my_first_django_container
# Docker-related targets
build:
$(DOCKER_BUILD) -t $(PROJECT_NAME) .
start:
$(DOCKER_COMPOSE) up -d
$(DOCKER_COMPOSE) logs -f app
down:
$(DOCKER_COMPOSE) down
restart:
$(DOCKER_COMPOSE) restart
logs:
$(DOCKER_COMPOSE) logs -f app
clean:
docker system prune -f
# Django-related targets
makemigrations:
$(DOCKER_COMPOSE) up -d app # Start the "app" service if not running
$(DOCKER_COMPOSE) exec app python manage.py makemigrations
migrate:
$(DOCKER_COMPOSE) up -d app # Start the "app" service if not running
$(DOCKER_COMPOSE) exec app python manage.py migrate
test:
$(DOCKER_COMPOSE) up -d app # Start the "app" service if not running
$(DOCKER_COMPOSE) exec app python manage.py test
createsuperuser:
$(DOCKER_COMPOSE) up -d app # Start the "app" service if not running
$(DOCKER_COMPOSE) exec app python manage.py createsuperuser