lua-resty-shell 是一个很不错的项目,让我们可以无阻塞的执行shell命令,之间的通信
是通过socket (一般是unix socket)
环境准备
docker-compose 文件
version: "3"
services:
app:
build: ./
ports:
- "8080:80"
volumes:
- "./app/:/opt/app/"
- "./nginx.conf:/usr/local/openresty/nginx/conf/nginx.conf"
dockerfile
FROM openresty/openresty:alpine-fat
LABEL author="1141591465@qq.com"
WORKDIR /sockproc
COPY ./sockproc/ /sockproc/
RUN make sockproc
COPY entrypoint.sh /entrypoint.sh
COPY sockproc.sh /sockproc.sh
COPY shell.lua /usr/local/openresty/lualib/resty/shell.lua
ENTRYPOINT [ "/entrypoint.sh" ]
dockerfile 说明
dockerfile 同时进行了socket 服务的构建以及shell lua 封装的copy,entrypoint 进行服务的启动
entrypoint.sh:
#!/bin/sh</