• 制作openresty的docker镜像 + nginx笔记 调试rewrite和location Nginx 学习笔记


    1.Dockerfile

    FROM centos:7.6.1810
     
    MAINTAINER openresty1.15.8.2 <dingxiaowei@do1.com>
     
    RUN   yum install -y yum-utils && yum-config-manager --add-repo https://openresty.org/package/centos/openresty.repo && yum clean  all &&  yum install -y openresty  
    
    
    RUN useradd appuser &&  mkdir -p /mnt/data/logs/nginx/ && mkdir -p /home/appuser/openresty/nginx/logs/ &&  mkdir -p /home/appuser/www-prod/
    ADD ./www-prod/ /home/appuser/www-prod/
    ADD ./html /usr/local/openresty/nginx/html/
    ADD ./conf/ /usr/local/openresty/nginx/conf/
    RUN chown -R appuser.appuser /usr/local/openresty/ && chown -R appuser.appuser /home/appuser/
    #RUN yum -y install epel-release  && 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 8004
    CMD /usr/local/openresty/nginx/sbin/nginx -g 'daemon off;' -c   /usr/local/openresty/nginx/conf/nginx.conf

    2.构建镜像

    docker build -t openresty:1.15.8.2 -f ./Dockerfile .

    3.山东环境ip

    [root@frontend-1 openresty]# ip a
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host 
           valid_lft forever preferred_lft forever
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
        link/ether 52:54:00:28:ee:89 brd ff:ff:ff:ff:ff:ff
        inet 172.17.0.17/20 brd 172.17.15.255 scope global eth0
           valid_lft forever preferred_lft forever
        inet6 fe80::5054:ff:fe28:ee89/64 scope link 
           valid_lft forever preferred_lft forever

     4.https://www.cnblogs.com/xjnotxj/p/13094290.html 调试rewrite和location

  • 相关阅读:
    三种方式循环打印1-100的值
    线程中put(None)和主函数中put(None)的区别和用法
    进程、线程这篇博客,让你傻傻的一次就能记清楚
    单生产者进程和单消费者进程
    队列
    初始线程
    常见面试题之*args
    常见面试题之*args 和 **kwargs 的使用
    闭包函数之函数加括号和不加括号的意义
    仓鼠找sugar II
  • 原文地址:https://www.cnblogs.com/hixiaowei/p/13949861.html
Copyright © 2020-2023  润新知