circus && web comsole docker-compose 独立部署
问题的根本原因是web console 的bug(实际上还是python 对于依赖版本出来不明确)
circus 进程docker 镜像
- dockerfile
FROM python:slim-stretch
LABEL AUTHOR="dalongrong"
LABEL EMAIL="1141591465@qq.com"
WORKDIR /app
RUN apt-get update && apt-get install -y --reinstall build-essential \
&& pip install circus chaussette \
&& apt-get remove -y --purge build-essential \
&& rm -rf /var/lib/apt/lists/*
COPY circus.ini /app/
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
- entrypoint.sh
#!/bin/sh
circusd /app/circus.ini
- circus demo 配置文件
[circus]
statsd = True
[watcher:webapp]
cmd = /usr/local/bin/chaussette --fd $(circus.sockets.web)
numprocesses = 5
use_sockets = True
[socket:web]
host = 0.0.0.0
port = 9999
circus web console docker 镜像
- dockerfile
说明因为pyzmq 以及tornado 版本的问题,进行了特殊处理
FROM python:2.7-slim-stretch
LABEL AUTHOR="dalongrong"
LABEL EMAIL="1141591465@qq.com"
RUN apt-get update && apt-get install -y --reinstall build-essential \
&& pip install circus-web \
&& pip uninstall -y tornado \
&& pip uninstall -y pyzmq \
&& pip install tornado==3.2.2 \
&& pip install pyzmq==16.0.4 \
&& apt-get remove -y --purge build-essential \
&& rm -rf /var/lib/apt/lists/*
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
- entrypoint
#!/bin/sh
circushttpd
集成试用
使用docker-compose
- docker-compose 文件
version: "3"
services:
circus:
image: dalongrong/circus:3.7-slim-stretch
ports:
- "9999:9999"
- "5555:5555"
volumes:
- "./circus.ini:/app/circus.ini"
circus-web:
image: dalongrong/circusd-web:2.7-slim-stretch
ports:
- "8080:8080"
- circus 配置文件
数据卷挂载方式
[circus]
statsd = True
check_delay = 5
endpoint = tcp://0.0.0.0:5555
pubsub_endpoint = tcp://0.0.0.0:5556
stats_endpoint= tcp://0.0.0.0:5557
[watcher:webapp]
cmd = /usr/local/bin/chaussette --fd $(circus.sockets.web)
numprocesses = 5
use_sockets = True
[socket:web]
host = 0.0.0.0
port = 9999
启动&&效果
- 启动
docker-compose up -d
- socket 访问
- web console 访问
说明
因为web console 获取circus stats 接口地址错误(bug),造成无法获取进行的统计信息,只能进行操作处理,同时这种处理方式并不是很安全,实际推荐
基于ipc 通信,并通过ssh tunneling 进行管理以及通信信息查看
参考资料
https://github.com/rongfengliang/circusd-web-docker
https://github.com/rongfengliang/circusd-docker
https://github.com/rongfengliang/circus-docker-compose
https://cloud.docker.com/repository/docker/dalongrong/circusd-web
https://cloud.docker.com/repository/docker/dalongrong/circusd
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2018-06-11 yarn import 使用package-lock.json
2018-06-11 nats 学习 request/reply 模式基本使用
2017-06-11 Cascalog了解