-
Notifications
You must be signed in to change notification settings - Fork 4
/
start.sh
executable file
·59 lines (46 loc) · 1.26 KB
/
start.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
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
source conf
if [ "$GAZIE_FOLDER" != "" ]; then
PATH_FOLDER_NGINX="/app/$GAZIE_FOLDER"
PATH_FOLDER_PHP="/var/www/html/$GAZIE_FOLDER"
else
PATH_FOLDER_NGINX="/app"
PATH_FOLDER_PHP="/var/www/html"
fi
mkdir -p $PATH_DB $PATH_BACKUP
cp -aR gazie/data/* $PATH_BACKUP/
chmod -R 777 $PATH_BACKUP
echo "Stop all service"
echo "..."
source stop.sh
docker run -d \
-e MYSQL_ROOT_PASSWORD=$PASS_DB \
-v $PATH_DB:/var/lib/mysql \
-p $MYSQL_PORT:3306 \
--name db \
gazie-mariadb:10.2
if [ "$GAZIE_VERSION" == "dev" ]; then
# Mount the local path
docker run -d --link db \
-v $PATH_LOCAL/gazie:$PATH_FOLDER_PHP \
-v $PATH_CONFIG:$PATH_FOLDER_PHP/config/config \
--name phpfpm gazie-docker:${GAZIE_VERSION}
docker run -d --link phpfpm \
--name nginx \
-v $PATH_LOCAL/gazie:$PATH_FOLDER_NGINX \
-v $PATH_BACKUP:$PATH_FOLDER_NGINX/data \
-p $PORT_EXTERNAL:80 \
gazie-nginx:${GAZIE_VERSION}
else
# Mount whithout local
docker run -d --link db \
-v $PATH_CONFIG:$PATH_FOLDER_PHP/config/config \
-v $PATH_BACKUP:$PATH_FOLDER_PHP/data \
--name phpfpm gazie-docker:${GAZIE_VERSION}
docker run -d --link phpfpm \
--name nginx \
-v $PATH_BACKUP:$PATH_FOLDER_NGINX/data \
-p $PORT_EXTERNAL:80 \
gazie-nginx:${GAZIE_VERSION}
fi
./run_phpmyadmin.sh