项目作者: rongfengliang

项目描述 :
circus-docker
高级语言: Dockerfile
项目地址: git://github.com/rongfengliang/circus-docker.git
创建时间: 2019-06-09T13:26:35Z
项目社区:https://github.com/rongfengliang/circus-docker

开源协议:

下载


python circus docker image

use pip install

Usage

  • pull docker image
  1. docker pull dalongrong/circus
  • demo dockerfile

Dockerfile-Test

  1. FROM dalongrong/circus
  2. WORKDIR /app
  3. COPY circus.ini /app/
  4. COPY entrypoint.sh /entrypoint.sh
  5. RUN chmod +x /entrypoint.sh
  6. ENTRYPOINT [ "/entrypoint.sh" ]
  • circus config

circus.ini

  1. [circus]
  2. statsd = True
  3. httpd = False
  4. [watcher:webapp]
  5. cmd = /usr/local/bin/chaussette --fd $(circus.sockets.web)
  6. numprocesses = 5
  7. use_sockets = True
  8. [socket:web]
  9. host = 0.0.0.0
  10. port = 9999
  • docker-compose.yaml file
  1. version: "3"
  2. services:
  3. circus:
  4. build: ./
  5. web:
  6. build:
  7. dockerfile: Dockerfile-Test
  8. context: ./
  9. ports:
  10. - "9999:9999"
  11. - "8080:8080"
  • running
  1. docker-compose up -d web
  • view result
  1. open http://localhost:9999

some notes [fixed use dalongrong/circus:2.7-slim-stretch works]

current circushttpd maybe not work still solve it

exception message like below

  1. web_1 | SyntaxError: invalid syntax
  2. web_1 | Traceback (most recent call last):
  3. web_1 | File "<string>", line 1, in <module>
  4. web_1 | File "/usr/local/lib/python3.7/site-packages/circusweb/circushttpd.py", line 25, in <module>
  5. web_1 | import tornadio2
  6. web_1 | File "/usr/local/lib/python3.7/site-packages/tornadio2/__init__.py", line 25, in <module>
  7. web_1 | from tornadio2.router import TornadioRouter
  8. web_1 | File "/usr/local/lib/python3.7/site-packages/tornadio2/router.py", line 27, in <module>
  9. web_1 | from tornadio2 import persistent, polling, sessioncontainer, session, proto, preflight, stats
  10. web_1 | File "/usr/local/lib/python3.7/site-packages/tornadio2/persistent.py", line 143
  11. web_1 | except Exception, ex:
  12. web_1 | ^
  13. web_1 | SyntaxError: invalid syntax