-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·50 lines (40 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
50
include .env
build:
make stop_services
sudo chmod 777 -R mysql || true
docker compose -f docker-compose.yml build
docker compose -f docker-compose.yml up -d
docker exec $(CONTAINER_PREFIX)_php composer install
docker exec $(CONTAINER_PREFIX)_php [ ! -f .env ] \
&& docker exec $(CONTAINER_PREFIX)_php cp -n .env.example .env \
&& docker exec $(CONTAINER_PREFIX)_php php artisan key:generate
docker exec $(CONTAINER_PREFIX)_php chmod 777 -R .
docker exec $(CONTAINER_PREFIX)_php php artisan storage:link
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 mysql
sudo rm -rf mysql
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 mysql start || true
sudo service nginx start || true
sudo service redis start || true
stop_services:
sudo service mysql stop || true
sudo service nginx stop || true
sudo service redis stop || true
.PHONY: build up stop down ex analyse purge start_services stop_services