-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdeploy.sh
57 lines (50 loc) · 1.35 KB
/
deploy.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
# 部署项目
# 重新构建
set -e
CURL_PATH=/app/docker-openresty-php-fpm
cd /app/docker-openresty-php-fpm
export_image() {
echo "[export] 开始 启动 "
docker export shengle-o-p >shengle-o-p.tar
echo "[export] 启动 完成"
}
import_image() {
echo "[import] 开始 启动 "
docker import ./shengle-o-p.tar s-o-p
echo "[import] 启动 完成"
}
stop() {
echo "[stop] 开始 启动 "
docker stop shengle-o-p
docker rm shengle-o-p
echo "[stop] 启动 完成"
}
start() {
echo "[start] 开始 启动 "
docker run -it -d -p 9080:80 -p 9443:443 \
-v $CURL_PATH/php/php.ini:/usr/local/etc/php/php.ini \
-v $CURL_PATH/php/php-fpm.d:/usr/local/etc/php-fpm.d \
-v $CURL_PATH/nginx/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf \
-v $CURL_PATH/nginx/conf.d:/etc/nginx/conf.d \
-v $CURL_PATH/supervisor/supervisord.conf:/etc/supervisord.conf \
-v $CURL_PATH/supervisor/conf.d:/etc/supervisor/conf.d \
-v /app:/app \
-v /home/wwwlogs:/home/www-data/wwwlogs \
--name shengle-o-p \
s-o-p \
/usr/bin/supervisord -n -c /etc/supervisord.conf
echo "[start] 启动 完成"
}
# 部署
deploy() {
# 导出镜像
# export_image
# 导入镜像
import_image
# 停止镜像
stop
# 启动
start
}
deploy