@@ -6,30 +6,46 @@ default: up
6
6
7
7
DRUPAL_ROOT ?= /var/www/html/web
8
8
9
+ # # help : Print commands help.
10
+ help : docker.mk
11
+ @sed -n ' s/^##//p' $<
12
+
13
+ # # up : Start up containers.
9
14
up :
10
15
@echo " Starting up containers for $( PROJECT_NAME) ..."
11
16
docker-compose pull
12
17
docker-compose up -d --remove-orphans
13
18
19
+ # # down : Stop containers.
14
20
down : stop
15
21
22
+ # # stop : Stop containers.
16
23
stop :
17
24
@echo " Stopping containers for $( PROJECT_NAME) ..."
18
25
@docker-compose stop
19
26
27
+ # # prune : Remove containers and their volumes.
20
28
prune :
21
29
@echo " Removing containers for $( PROJECT_NAME) ..."
22
30
@docker-compose down -v
23
31
32
+ # # ps : List running containers.
24
33
ps :
25
34
@docker ps --filter name=' $(PROJECT_NAME)*'
26
35
36
+ # # shell : Access `php` container via shell.
27
37
shell :
28
38
docker exec -ti -e COLUMNS=$(shell tput cols) -e LINES=$(shell tput lines) $(shell docker ps --filter name='$(PROJECT_NAME ) _php' --format "{{ .ID }}") sh
29
39
40
+ # # drush : Executes `drush` command in a specified `DRUPAL_ROOT` directory (default is `/var/www/html/web`).
41
+ # # Doesn't support --flag arguments.
30
42
drush :
31
43
docker exec $(shell docker ps --filter name='^/$(PROJECT_NAME ) _php' --format "{{ .ID }}") drush -r $(DRUPAL_ROOT ) $(filter-out $@ ,$(MAKECMDGOALS ) )
32
44
45
+ # # logs : View containers logs.
46
+ # # You can optinally pass an argument with the service name to limit logs
47
+ # # logs php : View `php` container logs.
48
+ # # logs nginx php : View `nginx` and `php` containers logs.
33
49
logs :
34
50
@docker-compose logs -f $(filter-out $@ ,$(MAKECMDGOALS ) )
35
51
0 commit comments