circus && web comsole docker-compose 独立部署
  TEZNKK3IfmPf 2023年11月13日 23 0

 问题的根本原因是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 访问

circus  && web comsole docker-compose 独立部署

 

 

  • web console 访问

circus  && web comsole docker-compose 独立部署

circus  && web comsole docker-compose 独立部署

说明

因为web console 获取circus stats 接口地址错误(bug),造成无法获取进行的统计信息,只能进行操作处理,同时这种处理方式并不是很安全,实际推荐
基于ipc 通信,并通过ssh tunneling 进行管理以及通信信息查看

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月13日 0

暂无评论

推荐阅读
  TEZNKK3IfmPf   2024年03月22日   58   0   0 容器Docker
  TEZNKK3IfmPf   2024年04月26日   50   0   0 Docker
  TEZNKK3IfmPf   2024年03月29日   94   0   0 Docker
  TEZNKK3IfmPf   2023年11月15日   28   0   0 Web
TEZNKK3IfmPf