-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·41 lines (35 loc) · 899 Bytes
/
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
#!/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
#navigate to application directory
# shellcheck disable=SC2164
cd app
if [ -f ".env" ]; then
echo ".env already exists"
else
echo "Coping .env.example to .env"
cp .env.example .env
fi
# shellcheck disable=SC2103
cd ..
#docker
#up containers
echo "Starting containers"
docker-compose up -d
#composer dependencies
echo "Installing composer dependencies"
docker-compose exec php composer install
#up containers
echo "Re-start containers"
docker-compose restart