lapis 1.7.0 更好的openresty 版本兼容以及安全数据库支持

lapis 1.7.0 今年4月2号就发布了,一直没有注意,今天看到changelog就简单的进行了一个
测试(主要是与openresty版本的测试,新变更后边会有)

使用docker-compose 运行

环境准备

  • docker-compose 文件
version: "3"
services:
 api:
   build: ./
   ports:
   - "8080:8080"
  • dockerfile
FROM openresty/openresty:alpine-fat
RUN apk add openssl-dev
RUN /usr/local/openresty/luajit/bin/luarocks install lapis
WORKDIR /web
RUN lapis new --lua
ENTRYPOINT [ "lapis","server" ]

运行&&测试

  • 启动
docker-compose up -d

说明

可以为lapis 做一个基础镜像,方便后期使用,如下:

FROM openresty/openresty:alpine-fat
RUN apk add openssl-dev
WORKDIR /web
RUN /usr/local/openresty/luajit/bin/luarocks install lapis

我构建的为 dalongrong/lapis-1.7.0:latest,后期使用

FROM dalongrong/lapis-1.7.0:latest
WORKDIR /web
RUN lapis new --lua
ENTRYPOINT [ "lapis","server" ]

参考资料

http://leafo.net/lapis/reference/lua_getting_started.html
http://leafo.net/lapis/changelog.html
https://github.com/rongfengliang/lapis-docker

猜你喜欢

转载自www.cnblogs.com/rongfengliang/p/10073243.html
今日推荐