-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
33 lines (24 loc) · 1008 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
# ---------------------------------------------------------------------------- #
# COMMAND #
# ---------------------------------------------------------------------------- #
DOCKER_COMPOSE := $(shell \
if command -v docker compose > /dev/null 2>&1; then \
echo "docker compose"; \
else \
echo "docker-compose"; \
fi)
# ---------------------------------------------------------------------------- #
# RULES #
# ---------------------------------------------------------------------------- #
all: build migrate logs
build:
@$(DOCKER_COMPOSE) up --build -d
logs:
@$(DOCKER_COMPOSE) logs -f $(SERVICE)
migrate:
@$(DOCKER_COMPOSE) exec backend python home_api/manage.py makemigrations
@$(DOCKER_COMPOSE) exec backend python home_api/manage.py migrate
down:
@$(DOCKER_COMPOSE) down
re: down all
.PHONY: all build logs migrate down re