-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
49 lines (39 loc) · 1.25 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
include .env
build:
make stop_services
sudo chmod 777 -R postgresql || true
docker-compose -f docker-compose.yml build
docker-compose -f docker-compose.yml up -d
docker exec -d $(CONTAINER_PREFIX)_php composer install
docker exec -d $(CONTAINER_PREFIX)_php [ ! -f .env ] \
&& docker exec -d $(CONTAINER_PREFIX)_php cp -n .env.example .env \
&& docker exec -d $(CONTAINER_PREFIX)_php php artisan key:generate
docker exec -d $(CONTAINER_PREFIX)_php chmod 777 .env storage
make stop
echo "Build complete"
up:
make stop_services
docker-compose -f docker-compose.yml up -d
stop:
docker-compose -f docker-compose.yml stop
make start_services
down:
docker-compose -f docker-compose.yml down
make start_services
purge:
docker rmi -f $(CONTAINER_PREFIX)
sudo chmod -R +rwx postgresql
sudo rm -rf postgresql
ex:
docker exec -it $(CONTAINER_PREFIX)_php /bin/sh
analyse:
cd src && composer analyse 2>&1 | tee storage/logs/analyse.log
start_services:
sudo service redis-server start || true
sudo service postgresql start || true
sudo service nginx start || true
stop_services:
sudo service redis-server stop || true
sudo service postgresql stop || true
sudo service nginx stop || true
.PHONY: build up stop down ex analyse purge start_services stop_services