zoukankan      html  css  js  c++  java
  • Nginx的Docker容器化配置

      这里只是做一个简单的演示,基础镜像选用 CentOS 7,Nginx 选用 Nginx 的扩展版本 OpenResty 1.15.8.2。

      Nginx 镜像 Dockerfile 脚本如下:

    FROM centos:centos7
    MAINTAINER Nginx Dockerfile Write by John.Wang
    RUN yum -y install epel-release && yum -y install wget gcc make pcre-devel 
        zlib-devel openssl-devel libxml2-devel libxslt-devel luajit GeoIP-devel 
        gd-devel libatomic_ops-devel luajit-devel perl-devel perl-ExtUtils-Embed
    
    RUN cd /tmp && wget https://openresty.org/download/openresty-1.15.8.2.tar.gz  && 
        tar zxmf openresty-1.15.8.2.tar.gz && 
        cd openresty-1.15.8.2 && 
        ./configure 
            --with-threads 
            --with-file-aio 
            --with-http_ssl_module 
            --with-http_v2_module 
            --with-http_realip_module 
            --with-http_addition_module 
            --with-http_xslt_module=dynamic 
            --with-http_image_filter_module=dynamic 
            --with-http_geoip_module=dynamic 
            --with-http_sub_module 
            --with-http_dav_module 
            --with-http_flv_module 
            --with-http_mp4_module 
            --with-http_gunzip_module 
            --with-http_gzip_static_module 
            --with-http_auth_request_module 
            --with-http_random_index_module 
            --with-http_secure_link_module 
            --with-http_degradation_module 
            --with-http_slice_module 
            --with-http_stub_status_module 
            --with-stream=dynamic 
            --with-stream_ssl_module 
            --with-stream_realip_module 
            --with-stream_geoip_module=dynamic 
            --with-libatomic 
            --with-pcre-jit 
            --with-stream_ssl_preread_module && 
        gmake && gmake install
    ENV PATH $PATH:/usr/local/nginx/sbin
    RUN ln -s /usr/local/openresty/nginx /usr/local/nginx
    RUN ln -sf /dev/stdout /usr/local/nginx/logs/access.log &&
        ln -sf /dev/stderr /usr/local/nginx/logs/error.log
    EXPOSE 80
    ENTRYPOINT ["nginx", "-g", "daemon off;"]

    Dockerfile 文件的同一目录下,执行如下命令构建 Nginx Dokcer 镜像。

    docker build -t nginx:v1.0 .

    作者:小家电维修

    相见有时,后会无期。

  • 相关阅读:
    数据结构_线性结构
    多线程01_基础
    操作系统05_文件管理
    解析静态内部类的使用目的与限制(转)
    mysql去除重复记录案例
    mysql 索引使用策略及优化
    mysql 索引数据结构及原理
    mysql 索引的简单使用
    当一个线程进入一个对象的一个synchronized方法后,其它线程是否可进入此对象的其它方法
    14 线程间协作的两种方式:wait、notify、notifyAll和Condition
  • 原文地址:https://www.cnblogs.com/lizexiong/p/15032552.html
Copyright © 2011-2022 走看看