项目作者: shangxianapp

项目描述 :
Nginx Alpine image, support Lua 、nginx-echo 、nginx-brotli 、nginx-http-concat 、WebP 、TLSv1.3
高级语言: Shell
项目地址: git://github.com/shangxianapp/docker-nginx-alpine.git
创建时间: 2019-02-14T08:51:06Z
项目社区:https://github.com/shangxianapp/docker-nginx-alpine

开源协议:MIT License

下载


docker-nginx-alpine

Nginx v1.14.2 Alpine 镜像,支持 以下模块:

使用

直接覆盖默认配置文件

  1. # ./nginx.conf
  2. server {
  3. ...
  4. }
  1. docker run \
  2. --name nginx \
  3. -v "$(pwd)/nginx.conf":/etc/nginx/conf.d/default.conf \
  4. -p 80:80 \
  5. -p 443:443 \
  6. ghcr.io/shangxianapp/nginx:latest-alpine

自定义 Nginx 入口配置

  1. docker run \
  2. --name nginx \
  3. -v "$(pwd)/nginx.conf":/etc/nginx/nginx.conf \
  4. -v "$(pwd)/vhost":/etc/nginx/vhost \
  5. -p 80:80 \
  6. -p 443:443 \
  7. ghcr.io/shangxianapp/nginx:latest-alpine

功能

二次 LuaRocks 安装:

  1. FROM ghcr.io/shangxianapp/nginx:latest-alpine
  2. WORKDIR /etc/nginx
  3. RUN luarocks install lua-cjson
  4. RUN luarocks install luasocket
  5. COPY . .
  6. EXPOSE 80 443
  7. CMD ["nginx", "-g", "daemon off;"]%

注意

为了让 Lua 有写入文件权限,在创建 nginx 用户时使用了 -u 1000 以提高用户权限。

开发

构建镜像

  1. make build

测试

为了测试 HTTPS 支持,请添加 Hosts 127.0.0.1 www.fe.com ,并运行:

  1. make test

License

MIT