docker运行cabot

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

《docker运行cabot》

summary

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

docs

    原文作者:codecraft
    原文地址: https://segmentfault.com/a/1190000007003067
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞