File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -57,8 +57,20 @@ yum install -y yum-utils device-mapper-persistent-data lvm2
5757yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
5858yum install -y docker-ce
5959```
60+ 2 . 配置容器日志
61+ ``` shell
62+ cat > /etc/docker/daemon.json << EOF
63+ {
64+ "log-driver": "json-file",
65+ "log-opts": {
66+ "max-size": "50m",
67+ "max-file": "1"
68+ }
69+ }
70+ EOF
71+ ```
6072
61- 2 . 启动 docker
73+ 3 . 启动 docker
6274``` shell
6375# centos7+
6476systemctl enable docker # 开机自启
@@ -67,21 +79,21 @@ systemctl start docker # 启动
6779docker -v
6880```
6981
70- 3 . 安装 docker-compose
82+ 4 . 安装 docker-compose
7183``` shell
7284curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-` uname -s` -` uname -m` > /usr/local/bin/docker-compose
7385chmod +x /usr/local/bin/docker-compose
7486```
7587
76- 4 . 启动 php-nginx
88+ 5 . 启动 php-nginx
7789``` shell
7890# cd 到 www 目录,拉取代码
7991# 新增 nginx/conf.d/${appName}.conf,配置虚拟主机
8092# 新增 ningx/logs/${appName},创建应用 nginx 日志目录
8193docker-compose up -d --build
8294```
8395
84- 5 . 配置 nginx 日志切割
96+ 6 . 配置 nginx 日志切割
8597```
8698# chmod +x sh/docker_nginx_log_cutting.sh
8799# crontab
You can’t perform that action at this time.
0 commit comments