-
-
Notifications
You must be signed in to change notification settings - Fork 98
/
Makefile
33 lines (23 loc) · 905 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
.PHONY: up down nginx php phplog nginxlog db coverage vendor
MAKEPATH := $(abspath $(lastword $(MAKEFILE_LIST)))
PWD := $(dir $(MAKEPATH))
CONTAINERS := $(shell docker ps -a -q -f "name=rest-api-slim-php*")
up:
docker-compose up -d --build
down:
docker-compose down
nginx:
docker exec -it rest-api-slim-php-nginx-container bash
php:
docker exec -it rest-api-slim-php-php-container bash
phplog:
docker logs rest-api-slim-php-php-container
nginxlog:
docker logs rest-api-slim-php-nginx-container
db:
docker-compose exec mysql mysql -e 'DROP DATABASE IF EXISTS rest_api_slim_php ; CREATE DATABASE rest_api_slim_php;'
docker-compose exec mysql sh -c "mysql rest_api_slim_php < docker-entrypoint-initdb.d/database.sql"
coverage:
docker-compose exec php-fpm sh -c "./vendor/bin/phpunit --coverage-text --coverage-html coverage"
vendor:
docker-compose exec php-fpm sh -c "composer install"