-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (43 loc) · 1.54 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
COMPOSER = composer
DC = docker compose
GID = $(shell id -g)
NODE = node:lts-slim
NODE_PKG_MNGR = yarn
PWD = $(shell pwd)
UID = $(shell id -u)
USER = $(shell whoami)
.PHONY: docker_build
docker_build:
$(DC) build --no-cache
.PHONY: docker_up
docker_up:
$(DC) up --force-recreate --remove-orphans
# use standalone container to avoid root owned vendor directory
.PHONY: composer_install
composer_install:
docker run --rm -ti -v $(PWD):/app --user $(UID):$(GID) $(COMPOSER) install
# use standalone container to avoid root owned vendor directory
.PHONY: composer_update
composer_update:
docker run --rm -ti -v $(PWD):/app --user $(UID):$(GID) $(COMPOSER) update
# TODO: add node to docker-compose or keep it as standalone container ?
.PHONY: node_install
node_install:
docker run --rm --name node_nginx-fpm -u node -w /home/node/app -v $(PWD):/home/node/app $(NODE) $(NODE_PKG_MNGR) install
# TODO: add node to docker-compose or keep it as standalone container ?
.PHONY: node_upgrade
node_upgrade:
docker run --rm --name node_nginx-fpm -u node -w /home/node/app -v $(PWD):/home/node/app $(NODE) $(NODE_PKG_MNGR) upgrade
.PHONY: node_watch
node_watch:
# TODO: add node to docker-compose ro keep it as standalone container ?
docker run --rm --name node_nginx-fpm -u node -w /home/node/app -v $(PWD):/home/node/app $(NODE) $(NODE_PKG_MNGR) watch
.PHONY: database
database:
$(DC) exec php-fpm composer database
.PHONY: database-dev
database-dev:
$(DC) exec php-fpm composer database-dev
.PHONY: database-test
database-test:
$(DC) exec php-fpm composer database-test