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 .

    作者:小家电维修

    相见有时,后会无期。

  • 相关阅读:
    matlab代码学习_2018728
    理解面向对象过程中创造一个对象的步骤
    html字符及空格占位问题
    div中img(及文字等inline元素和block元素)的自动换行
    css布局居中
    css3前缀解决方案
    自己写一个树形导航菜单
    《JavaScript核心概念及实践》 读书笔记
    css常用属性
    windows下有个目录名称中间有空格 java读目录空格变成%20 处理方法
  • 原文地址:https://www.cnblogs.com/lizexiong/p/15032552.html
Copyright © 2011-2022 走看看