docker-compose

cabot:
  build: .
  links:
    - postgres
    - redis
    - smtp
  volumes:
    - /opt/cabot
  environment:
    DATABASE_URL: "postgres://postgres:cabot@postgres:5432/postgres"
    CELERY_BROKER_URL: "redis://redis:6379/1"
    SES_HOST: smtp
    SES_PORT: 25

# we do not use the official postgres image here as it does not start quickly
# enough for use with docker-compose
postgres:
  image: orchardup/postgresql
  environment:
    POSTGRESQL_USER: postgres
    POSTGRESQL_PASS: cabot
    POSTGRESQL_DB: postgres

redis:
  image: redis:2.8

smtp:
  image: tianon/exim4

nginx:
  image: nginx
  ports:
     - "8080:8080"
  links:
     - cabot
  volumes_from:
     - cabot
  volumes:
     - ./nginx.conf:/etc/nginx/nginx.conf:ro

dockerfile

# A Cabot container
#
# https://github.com/socialwareinc/cabot-docker
#
# VERSION 1.0

FROM ubuntu-upstart:trusty

RUN apt-get update
RUN apt-get install -y build-essential nodejs libpq-dev python-dev npm git \
                       curl libldap2-dev libsasl2-dev iputils-ping


RUN curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo python2.7


RUN git clone https://github.com/arachnys/cabot.git /opt/cabot
ADD fixture.json /opt/cabot/
ADD run.sh /opt/cabot/
ADD gunicorn.conf /opt/cabot/
ADD production.env /opt/cabot/conf/
ADD development.env /opt/cabot/conf/

RUN pip install -e /opt/cabot
RUN npm install --no-color -g coffee-script less@1.3

ENV PATH $PATH:/opt/cabot/
ENV PYTHONPATH $PYTHONPATH:/opt/cabot/

ENV DJANGO_SETTINGS_MODULE cabot.settings
ENV HIPCHAT_URL https://api.hipchat.com/v1/rooms/message
ENV LOG_FILE /var/log/cabot
ENV PORT 5000

ENV DJANGO_SECRET_KEY 2FL6ORhHwr5eX34pP9mMugnIOd3jzVuT45f7w430Mt5PnEwbcJgma0q8zUXNZ68A

RUN ["ln", "-s", "/usr/bin/nodejs", "/usr/bin/node"]

EXPOSE 5000
WORKDIR /opt/cabot/
CMD . /opt/cabot/run.sh

运行

docker-compose up
打开
http://192.168.99.100:8080/
admin/admin

clipboard.png

summary

依赖组件太多,另外没有配置了graphite没有生效,不能在ui进行配置,比较费劲,建议参考该功能,自己重写。

docs


codecraft
11.9k 声望2k 粉丝

当一个代码的工匠回首往事时,不因虚度年华而悔恨,也不因碌碌无为而羞愧,这样,当他老的时候,可以很自豪告诉世人,我曾经将代码注入生命去打造互联网的浪潮之巅,那是个很疯狂的时代,我在一波波的浪潮上留下...