91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

可根據配置文件變化自動reload的openresty docker鏡像制作

發布時間:2020-07-26 17:21:42 來源:網絡 閱讀:927 作者:zhaodelu 欄目:云計算

1.????? 創建工作目錄

mkdir?openresty?&&?cd?openresty

2.????? 編寫使用inotify監控配置文件變化并自動reload的腳本auto-reload.sh:

#!/bin/sh
inotifywait?-e?modify,move,create,delete?-mr?--timefmt?'%d/%m/%y?%H:%M'?--format?'%T?%f?%e'?\
/usr/local/openresty/nginx/conf/conf.d?|?while?read?event;?do
????echo?"$event"
????/usr/local/openresty/nginx/sbin/nginx?-s?reload
done

3.????? 編寫鏡像啟動腳本start.sh:

#!/bin/bash
/usr/bin/openresty?-g?"daemon?off;"?&
/auto-reload.sh

4.????? 編寫配置文件nginx.conf:

user?nobody;
worker_processes??auto;
#worker_cpu_affinity?01?10;
worker_rlimit_nofile?65535;
events?{
????use?epoll;
????worker_connections??60000;
}
http?{
????include???????mime.types;
????default_type??application/octet-stream;
????tcp_nodelay???on;
????log_format??main??'$status?$host?$remote_addr?$request_time?-?'
??????????????????????'$upstream_status?$upstream_addr?$upstream_response_time?'
??????????????????????'[$time_local]?$request?'
??????????????????????'$bytes_sent?$body_bytes_sent?"$http_referer"?'
??????????????????????'"$http_user_agent"?"$http_x_forwarded_for"';
????access_log?/usr/local/openresty/nginx/logs/access.log?main;
????error_log?/usr/local/openresty/nginx/logs/error.log;
????log_not_found??off;
????sendfile????????on;
????keepalive_timeout??15;
????server_names_hash_bucket_size?4096;
????client_header_buffer_size?16k;
????large_client_header_buffers?4?64k;
????gzip?on;
????gzip_http_version?1.0;
????gzip_proxied?????expired?no-cache?no-store?private?auth;
????gzip_types???????text/plain?application/x-javascript?text/css??application/xml?text/javascript;
????gzip_min_length??1000;
????gzip_comp_level?5;
????gzip_buffers????4?8k;
????gzip_disable?"MSIE?[1-6]\.(?!.*SV1)";
????include?localenv.d/*.conf;
????include?env.d/*.conf;
????include?conf.d/*.backend.cfg;
????include?conf.d/*.server.cfg;
????server?{
????????listen???????80;
????????server_name??localhost;
????????#access_log??logs/host.access.log??main;
????????location?/?{
????????????root???html;
????????????index??index.html?index.htm;
????????}
????????#error_page??404??????????????/404.html;
????????#?redirect?server?error?pages?to?the?static?page?/50x.html
????????#
????????error_page???500?502?503?504??/50x.html;
????????location?=?/50x.html?{
????????????root???html;
????????}
????}
}

5.????? 編寫dockerfile:

FROM?centos:7.6.1810
?
MAINTAINER?openresty1.15.8.2?<xxx@xxx.com>
?
ADD?auto-reload.sh?auto-reload.sh
ADD?start.sh?start.sh
RUN?yum?-y?install?epel-release?&&?yum?install?inotify-tools?-y?&&?yum?install?-y?yum-utils?&&?yum-config-manager?--add-repo?https://openresty.org/package/centos/openresty.repo?&&?yum?install?-y?openresty?&&?yum?clean?all?&&?chmod?+x?start.sh?&&?chmod?+x?auto-reload.sh
ADD?nginx.conf?/usr/local/openresty/nginx/conf/nginx.conf
EXPOSE?80
EXPOSE?443
CMD?["./start.sh"]

6.????? 執行docker build命令:

docker?build?-t?openresty:1.15.8.2?-f?./dockerfile?.

上述命令執行完后,就可以通過docker images看到剛制作好的openresty鏡像了

7.????? 驗證,用以下命令運行容器:

docker?run?-itd?-p?8080:80?-v?/data/logs:/usr/local/openresty/nginx/logs?-v?/data/nginx/conf.d:/usr/local/openresty/nginx/conf/conf.d?openresty:1.15.8.2

在宿主機目錄/data/nginx/conf.d下新增或修改配置文件,容器中的openresty會自動reload,鏡像制作成功。


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

疏勒县| 讷河市| 永德县| 蓬莱市| 英吉沙县| 无锡市| 和龙市| 神农架林区| 广丰县| 冀州市| 藁城市| 三亚市| 镇远县| 余干县| 拜城县| 泰安市| 蓬莱市| 梧州市| 鄯善县| 上高县| 黔东| 即墨市| 裕民县| 广德县| 丽江市| 怀集县| 敖汉旗| 铅山县| 林芝县| 盐池县| 清河县| 五台县| 额尔古纳市| 陆河县| 东台市| 绍兴市| 呼玛县| 唐海县| 宜宾县| 南丹县| 伊金霍洛旗|