在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
lua-resty-qless-web 是 lua-resty-qless 的web 管理界面以及lua-resty-template 模版引擎开发的,里面实现了一个简单的 环境准备
version: "3"
services:
app:
build: ./
ports:
- "8080:80"
volumes:
- "./app/:/opt/app/"
- "./nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf"
redis:
image: redis
ports:
- "6379:6379"
worker_processes 1;
user root;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
lua_code_cache off;
gzip on;
resolver 127.0.0.11;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
lua_package_path '/opt/app/lua-resty-qless-web/lib/?.lua;;';
init_by_lua_block {
local Qless_Web = require("resty.qless-web")
}
server {
listen 80;
server_name localhost;
charset utf-8;
root html;
default_type text/html;
# 配置web
location /web {
default_type text/html;
location /web/__static {
internal;
rewrite ^/web/__static(.*) $1 break;
root /opt/app/lua-resty-qless-web/static/;
}
content_by_lua_block {
local resty_qless = require "resty.qless"
local qless, err = resty_qless.new({
host = "redis",
port = 6379,
})
if not qless then
return ngx.say("Qless.new(): ", err)
end
local Qless_Web = require("resty.qless-web")
local web = Qless_Web:new({ client = qless, uri_prefix = "/web" })
web:run()
}
}
location / {
default_type text/html;
index index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
运行&&界面
docker-compose up -d
参考资料https://github.com/rongfengliang/lua-resty-qless-web-docker-compose |
请发表评论