-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathinstall.sh
executable file
·46 lines (38 loc) · 1.11 KB
/
install.sh
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
#!/bin/bash
#if already have docker-compose.yml and .env, then skip copy from example
if [ -f "docker-compose.yml" ]; then
echo "docker-compose.yml already exists"
else
echo "Coping docker-compose.yml.example to docker-compose.yml"
cp docker-compose.yml.example docker-compose.yml
fi
if [ -f ".env" ]; then
echo ".env already exists"
else
echo "Coping .env.example to .env"
cp .env.example .env
fi
read -p "Do you want to review the env file? y/n: " CHOICE
if [[ $CHOICE == "y" ]]; then
nano .env
fi
#laravel app
echo "Cloning latest version of laravel"
git clone https://github.com/laravel/laravel.git app
cp app/.env.example app/.env
#docker
#up containers
echo "Starting containers"
docker-compose up -d
#laravel app permissions
echo "Setting laravel app permissions"
sudo chmod -R 777 app/storage
sudo chmod -R 777 app/bootstrap/cache
#laravel dependencies
echo "Installing laravel dependencies"
docker-compose exec worker composer install --prefer-source
echo "Generating laravel key"
docker-compose exec app php artisan key:generate
#up containers
echo "Re-start containers"
docker-compose restart