使用docker搭建OpenResty开发环境


Dockerfile文件:

FROM centos:latest

RUN yum install -y pcre-devel openssl-devel gcc curl wget perl make \
    cd ~ \
    wget https://openresty.org/download/openresty-1.15.8.1.tar.gz \
    tar -xzvf openresty-1.15.8.1.tar.gz \
    cd openresty-1.15.8.1 \
    ./configure \
    gmake \
    gmake install
RUN PATH=$PATH:/usr/local/openresty/nginx/sbin:/usr/local/openresty/bin/
RUN mkdir -p /lua
RUN mkdir -p /usr/local/openresty/nginx/conf/conf.d
RUN nginx &

EXPOSE 80 443

docker-compose.yml文件:

version: '3.3'

services:

   openresty:
      build: ./dockerfile/openresty
      image: phonecom/openresty
      restart: always
      privileged: true
      ports:
        - "8888:80"
        - "4430:443"
      volumes:
        - "./etc/openresty/nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf"
        - "./etc/openresty/conf.d:/usr/local/openresty/nginx/conf/conf.d"
        - "./project/lua:/lua"
      command: 
        - /bin/sh
        - -c 
        - |
          while true;do sleep 100;done


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM