-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
67 lines (51 loc) · 1.32 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
PROJECT_NAME="laravel-ddd-example"
DOCKER_COMPOSE=docker-compose -p $(PROJECT_NAME) -f ./etc/docker/docker-compose.yml
## ----------------------
## Docker composer management
## ----------------------
.PHONY: build
build: ## Build the stack
$(DOCKER_COMPOSE) build --no-cache
.PHONY: up
up: ## Environment up!
$(DOCKER_COMPOSE) up -d --build --force-recreate --renew-anon-volumes
.PHONY: restart
restart: ## Restart environment.
$(DOCKER_COMPOSE) restart
.PHONY: bash
bash:
$(DOCKER_COMPOSE) exec -it app bash
.PHONY: destroy
destroy:
$(DOCKER_COMPOSE) down --remove-orphans --volumes
$(DOCKER_COMPOSE) rm --stop --volumes --force
.PHONY: logs
logs:
$(DOCKER_COMPOSE) logs app
## ----------------------
## Docker composer informational
## ----------------------
.PHONY: services
services:
$(DOCKER_COMPOSE) ps
.PHONY: networks
networks:
docker network ls
.PHONY: volumes
volumes:
docker volume ls
## ----------------------
## Laravel commands
## ----------------------
.PHONY: migrate
migrate:
$(DOCKER_COMPOSE) exec app bash -c "php ./apps/kanban-api/artisan migrate"
.PHONY: clean
clean:
$(DOCKER_COMPOSE) exec app bash -c "php ./apps/kanban-api/artisan cache:clear"
## ----------------------
## Helpers
## ----------------------
.PHONY: mac-restart-docker
mac-restart-docker:
killall Docker && open /Applications/Docker.app