run.apache.sh
923 Bytes
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
#! /bin/sh
dn="dmapmanager"
#停止容器
echo "正在关闭容器..."
docker stop $dn
docker rm $dn
curPath=$(readlink -f $(dirname $0))
#设置日志权限
chmod -R 777 $curPath
#设置端口
port1=""
if [ ! -n "$1" ] ;then
port1="8830"
echo "未设置端口,使用默认8830端口..."
else
port1=$1
echo "端口设置为$1 ..."
fi
#设置端口
port2=""
if [ ! -n "$2" ] ;then
port2="8840"
echo "未设置端口,使用默认8840端口..."
else
port2=$2
echo "端口设置为$2 ..."
fi
#启动容器和apache
echo "正在启动容器..."
set="--privileged=true -e TZ="Asia/Shanghai" --restart=always -e ALLOW_IP_RANGE=0.0.0.0/0"
docker run -d --name $dn $set -p $port1:80 -p $port2:81 -v $curPath/logs/apache.error:/var/log/httpd/error_log -v ${curPath}/html:/var/www/html -v $curPath:/usr/src/app -v $curPath/httpd.conf:/etc/httpd/conf/httpd.conf dci/dmapmanager:4.1-gdb
sleep 1
curl localhost:$port2/release