File tree Expand file tree Collapse file tree 4 files changed +57
-6
lines changed Expand file tree Collapse file tree 4 files changed +57
-6
lines changed Original file line number Diff line number Diff line change 1
1
nginxphp.tar.gz
2
+ nginxphp.tar
Original file line number Diff line number Diff line change
1
+
2
+ FROM lbbniu/lbbserver
3
+
4
+ MAINTAINER lbbniu lbbniu@gmail.com
5
+
6
+ #去除sshd 22
7
+ COPY ./run.sh /lbbniu/run.sh
8
+ #nginx 配置文件
9
+ COPY ./nginx.conf /lbbniu/nginx/conf/nginx.conf
10
+ #php 配置文件
11
+ COPY ./php.ini /lbbniu/php7/etc/php.ini
12
+ #php-fpm 配置文件
13
+ COPY ./php-fpm.conf /lbbniu/php7/etc/php-fpm.conf
14
+ #php-fpm 配置文件
15
+ COPY ./www.conf /lbbniu/php7/etc/php-fpm.d/www.conf
16
+
17
+ #nginx虚拟主机配置文件目录 日志目录 web主目录
18
+ VOLUME ["/lbbniu/nginx/conf/vhost","/lbbniu/logs","/lbbniu/wwwroot"]
19
+
20
+ #这里可以加入证书文件,实现ssh登录
21
+
22
+ RUN chmod 755 /lbbniu/run.sh && \
23
+ chmod 777 /lbbniu/logs && \
24
+ echo "Asia/Shanghai" > /etc/timezone
25
+ # 22 80
26
+ EXPOSE 80
27
+
28
+ CMD ["/lbbniu/run.sh"]
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # web网站的目录
3
+ WEBPATH=` pwd` /wwwroot
4
+ SERVERPATH=/lbbniu/wwwroot
5
+ # 容器名字
6
+ NAME=nginx-php
7
+ # 镜像
8
+ DC_IMAGE=lbbniu/nginx-php
9
+ LOCAL_IMAGE=lbbniu/lbbserver
10
+
11
+
12
+ docker stop $NAME
13
+ echo $NAME " 容器停止......."
14
+ docker rm -f $NAME
15
+ echo $NAME " 容器删除......."
16
+
17
+ docker rmi -f $DC_IMAGE
18
+ echo $DC_IMAGE " 镜像删除......."
19
+ docker build -f Dockerfile-lbbserver -t $DC_IMAGE .
20
+ echo $DC_IMAGE " 镜像构建成功......."
21
+ docker run -d -p 8080:80 -v $WEBPATH :$SERVERPATH --name $NAME $DC_IMAGE
22
+ echo $NAME " 启动成功 ....."
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
# web网站的目录
3
- export WEBPATH=` pwd` /wwwroot
4
- export SERVERPATH=/lbbniu/wwwroot
3
+ WEBPATH=` pwd` /wwwroot
4
+ SERVERPATH=/lbbniu/wwwroot
5
5
# 容器名字
6
- export NAME=nginx-php
6
+ NAME=nginx-php
7
7
# 镜像
8
- export DC_IMAGE=lbbniu/nginx-php
9
- export LOCAL_IMAGE=lbbniu/nginxphpserver
8
+ DC_IMAGE=lbbniu/nginx-php
9
+ LOCAL_IMAGE=lbbniu/nginxphpserver
10
10
11
- export filename=nginxphp.tar
11
+ filename=nginxphp.tar
12
12
if [ ! -e $filename .gz ]; then
13
13
wget http://cdn.vliang.com/nginxphp.tar.gz
14
14
echo " 下载" $filename " .gz 文件成功"
You can’t perform that action at this time.
0 commit comments