Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 323b5ca

Browse files
committed
modify readme
1 parent 16f377a commit 323b5ca

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

‎README.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
- sh/,shell 脚本
1010

1111
## 镜像说明
12-
- nginx,官方 nginx:1.15
12+
- nginx,官方 nginx:1.17.3
1313
- php-fpm,基于 php:7.1-fpm 的自定义镜像,除内置基础扩展外,该镜像已安装 gd、pdo_mysql、mcrpyt、zip、opcache、mongodb 扩展,如果需要安装其他扩展,可修改 Dockerfile
1414

1515
## docker-compose.yml
@@ -21,10 +21,10 @@
2121
> nginx、php-fpm 部分配置优化如下,请根据机器配置自行调整,相关文件及目录已挂载
2222
- nginx.conf
2323
- client_max_body_size 1024m,大文件上
24-
- proxy_read_timeout 240s,慢脚本支持 for proxy(java etc.)
24+
- proxy_read_timeout 240s,慢脚本支持 for proxy
2525
- fastcgi_read_timeout 240s,慢脚本支持 for fastcgi(php-fpm etc.)
26-
- worker_processes 4,**需要依据机器调优,CPU 核心数,grep 'model name' /proc/cpuinfo | wc -l**
27-
- worker_connections 1024,**需要依据机器调优,最大文件句柄数,ulimit -n**
26+
- worker_processes 4,**需要依据机器调优,CPU 核心数**,`grep 'model name' /proc/cpuinfo | wc -l`
27+
- worker_connections 1024,**需要依据机器调优,最大文件句柄数**,`ulimit -n`
2828
- gzip 相关已开启
2929
- log 日志重定向
3030
- www.conf
@@ -57,7 +57,14 @@ yum install -y yum-utils device-mapper-persistent-data lvm2
5757
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
5858
yum install -y docker-ce
5959
```
60-
2. 配置容器日志
60+
61+
2. 安装 docker-compose
62+
```shell
63+
curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
64+
chmod +x /usr/local/bin/docker-compose
65+
```
66+
67+
3. 配置容器日志
6168
```shell
6269
cat > /etc/docker/daemon.json << EOF
6370
{
@@ -70,7 +77,14 @@ cat > /etc/docker/daemon.json << EOF
7077
EOF
7178
```
7279

73-
3. 启动 docker
80+
4. 配置 nginx 日志切割
81+
```shell
82+
# chmod +x sh/docker_nginx_log_cutting.sh
83+
# crontab
84+
0 0 * * * /data/php-nginx/sh/docker_nginx_log_cutting.sh php-nginx_nginx_1 /data/php-nginx/nginx/logs/ &> /dev/null
85+
```
86+
87+
5. 启动 docker
7488
```shell
7589
# centos7+
7690
systemctl enable docker # 开机自启
@@ -79,23 +93,11 @@ systemctl start docker # 启动
7993
docker -v
8094
```
8195

82-
4. 安装 docker-compose
83-
```shell
84-
curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
85-
chmod +x /usr/local/bin/docker-compose
86-
```
87-
88-
5. 启动 php-nginx
96+
6. 启动 php-nginx
8997
```shell
9098
# cd 到 www 目录,拉取代码
9199
# 新增 nginx/conf.d/${appName}.conf,配置虚拟主机
92100
# 新增 ningx/logs/${appName},创建应用 nginx 日志目录
93101
docker-compose up -d --build
94102
```
95103

96-
6. 配置 nginx 日志切割
97-
```
98-
# chmod +x sh/docker_nginx_log_cutting.sh
99-
# crontab
100-
0 0 * * * /data/php-nginx/sh/docker_nginx_log_cutting.sh php-nginx_nginx_1 /data/php-nginx/nginx/logs/ &> /dev/null
101-
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /