Added docker-compose production environment

Change-Id: I3c57a3b6933e98fe20cb10e65debb6c724e48445
This commit is contained in:
aviau 2015-04-23 13:05:21 -04:00
parent b342e820b5
commit 0809e0d8fb
9 changed files with 133 additions and 22 deletions

View File

@ -4,3 +4,4 @@
.tox .tox
env env
.testrepository .testrepository
container-data

4
.gitignore vendored
View File

@ -6,6 +6,7 @@
*.egg-info *.egg-info
AUTHORS AUTHORS
ChangeLog ChangeLog
build
# documentation # documentation
doc/build doc/build
@ -15,3 +16,6 @@ doc/source/_build
.tox .tox
env env
.testrepository .testrepository
#Container data
container-data

View File

@ -17,7 +17,6 @@ RUN apt-get install -y subversion && \
svn checkout https://github.com/savoirfairelinux/monitoring-tools/trunk/packs/linux-keystone /packs/linux-keystone && \ svn checkout https://github.com/savoirfairelinux/monitoring-tools/trunk/packs/linux-keystone /packs/linux-keystone && \
apt-get remove -y subversion apt-get remove -y subversion
ADD requirements.txt surveil/requirements.txt ADD requirements.txt surveil/requirements.txt
RUN pip install -r /surveil/requirements.txt RUN pip install -r /surveil/requirements.txt
@ -25,15 +24,12 @@ ADD setup.py /surveil/setup.py
ADD setup.cfg /surveil/setup.cfg ADD setup.cfg /surveil/setup.cfg
ADD README.rst /surveil/README.rst ADD README.rst /surveil/README.rst
ADD etc/surveil /etc/surveil ADD etc/surveil /etc/surveil
ADD surveil /surveil/surveil
#ADD .git /surveil/.git #ADD .git /surveil/.git
ENV PBR_VERSION=DEV ENV PBR_VERSION=PROD
# Surveil API # We are using develop so that the code can be mounted when in DEV.
EXPOSE 8080 RUN cd surveil && python setup.py develop
CMD cd /surveil/ && \ CMD surveil-api
python setup.py develop && \
((sleep 40 && surveil-init) &) && \
sleep 20 && \
surveil-api --reload

View File

@ -0,0 +1,5 @@
Container data
==============
When running Surveil with docker-compose-production.yml, this folder will be filled with MongoDB and InfluxDB data.

View File

View File

26
docker-compose-common.yml Normal file
View File

@ -0,0 +1,26 @@
surveil:
build: .
shinken:
build: tools/docker/shinken_container/
mongo:
image: mongo
influxdb:
image: savoirfairelinux/influxdb
grafana:
image: savoirfairelinux/grafana
environment:
INFLUXDB_HOST: "influxdb"
INFLUXDB_PORT: "8086"
INFLUXDB_NAME: "db"
INFLUXDB_USER: "root"
INFLUXDB_PASS: "root"
bansho:
image: savoirfairelinux/bansho
environment:
BANSHO_BACKEND: "surveil"
BANSHO_SURVEIL_URL: "http://surveil:8080/"

View File

@ -0,0 +1,63 @@
surveil:
extends:
file: docker-compose-common.yml
service: surveil
links:
- mongo
- influxdb
- shinken
ports:
- "8080:8080"
environment:
PBR_VERSION: "PROD"
shinken:
extends:
file: docker-compose-common.yml
service: shinken
links:
- mongo
- influxdb
ports:
- "7767:7767"
mongo:
extends:
file: docker-compose-common.yml
service: mongo
ports:
- "27017:27017"
command:
"mongod --smallfiles"
volumes:
- ./container-data/mongodb:/data/db
influxdb:
extends:
file: docker-compose-common.yml
service: influxdb
environment:
PRE_CREATE_DB: "db"
ports:
- "8083:8083"
- "8086:8086"
volumes:
- ./container-data/influxdb:/data
grafana:
extends:
file: docker-compose-common.yml
service: grafana
ports:
- "80:80"
links:
- influxdb
bansho:
extends:
file: docker-compose-common.yml
service: bansho
ports:
- "8888:8888"
links:
- surveil

View File

@ -1,16 +1,23 @@
surveil: surveil:
build: . extends:
file: docker-compose-common.yml
service: surveil
links: links:
- mongo - mongo
- influxdb - influxdb
- shinken - shinken
ports: ports:
- "8080:8080" - "8080:8080"
environment:
PBR_VERSION: "DEV"
volumes: volumes:
- ./surveil:/surveil/surveil - ./surveil:/surveil/surveil
command: bash -c "cd /surveil/ && python setup.py develop && ((sleep 40 && surveil-init) &) && sleep 20 && surveil-api --reload"
shinken: shinken:
build: tools/docker/shinken_container/ extends:
file: docker-compose-common.yml
service: shinken
links: links:
- mongo - mongo
- influxdb - influxdb
@ -18,29 +25,38 @@ shinken:
- "7767:7767" - "7767:7767"
mongo: mongo:
image: mongo extends:
file: docker-compose-common.yml
service: mongo
ports: ports:
- "27017:27017" - "27017:27017"
command: command:
"mongod --smallfiles" "mongod --nojournal --smallfiles"
influxdb: influxdb:
image: savoirfairelinux/influxdb extends:
file: docker-compose-common.yml
service: influxdb
environment: environment:
PRE_CREATE_DB: "db;grafana" PRE_CREATE_DB: "db"
ports: ports:
- "8083:8083" - "8083:8083"
- "8086:8086" - "8086:8086"
grafana: grafana:
image: savoirfairelinux/grafana extends:
file: docker-compose-common.yml
service: grafana
ports: ports:
- "80:80" - "80:80"
links: links:
- influxdb - influxdb
environment:
INFLUXDB_HOST: "influxdb" bansho:
INFLUXDB_PORT: "8086" extends:
INFLUXDB_NAME: "db" file: docker-compose-common.yml
INFLUXDB_USER: "root" service: bansho
INFLUXDB_PASS: "root" ports:
- "8888:8888"
links:
- surveil