1- DOCKER = docker
2- CONTAINER = php-suite-api
3-
41ifndef TESTMETHOD
52FILTERARGS =
63else
@@ -14,38 +11,32 @@ help: ## help page
1411 @fgrep -h " ##" $(MAKEFILE_LIST ) | fgrep -v fgrep | sed -e ' s/\\$$//' | sed -e ' s/\(.*\):.*##[ \t]*/ \1 ## /' | column -t -s ' ##'
1512 @echo
1613
17- all : destroy update build run packages # # destroy update build run packages
14+ all : destroy update build up packages # # destroy update build run packages
1815
1916destroy : # # remove container
20- - $( DOCKER ) rm -f $( CONTAINER )
17+ docker-compose down
2118
22- build : # # build comtainer
23- $( DOCKER ) build --no-cache -t $( CONTAINER ) .
19+ build : # # build container
20+ @docker-compose build
2421
25- run : # # run
26- $(DOCKER ) run -d -v " $$ PWD" :/var/www/html/ --rm --name=$(CONTAINER ) -h $(CONTAINER ) .ett.local $(CONTAINER )
22+ up : # # run
23+ docker-compose up -d
24+ # # $(DOCKER) run -d -v "$$PWD":/var/www/html/ --rm --name=$(CONTAINER) -h $(CONTAINER).ett.local $(CONTAINER)
2725
2826stop : # # stop container
29- - $( DOCKER ) rm -f $( CONTAINER )
27+ docker-compose stop
3028
31- restart : stop run # # restart container and run
29+ restart : stop up # # restart container and run
3230
3331ssh : sh # # get a shell in the container (alias for sh)
3432sh : # # get a shell in the container
35- $( DOCKER ) exec -it $( CONTAINER ) /bin/bash
33+ @docker-compose exec web /bin/bash
3634
3735logs : # # show logs
38- $( DOCKER ) logs --follow $( CONTAINER )
36+ @docker-compose logs -f web
3937
4038test : # # run tests
41- $( DOCKER ) exec $( CONTAINER ) bash -c " cd /var/www/html && vendor/bin/phpunit -c test/phpunit.xml $( FILTERARGS) $( TESTFILE) "
39+ docker-compose exec web /bin/ bash -l -c " cd /var/www/html && vendor/bin/phpunit -c test/phpunit.xml $( FILTERARGS) $( TESTFILE) "
4240
4341packages : # # install packages
44- $(DOCKER ) exec -i -t $(CONTAINER ) /bin/bash -l -c " composer install 2>&1"
45-
46- pu : packages-update # # update packages (alias for packages-update)
47- packages-update : # # update packages
48- $(DOCKER ) exec -i -t $(CONTAINER ) /bin/bash -l -c " composer update 2>&1"
49-
50- update : # # update container
51- $(DOCKER ) pull $(shell awk '/^FROM/ { print $$2; exit }' Dockerfile)
42+ docker-compose run --rm web composer install
0 commit comments