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
env
.testrepository
container-data

4
.gitignore vendored
View File

@ -6,6 +6,7 @@
*.egg-info
AUTHORS
ChangeLog
build
# documentation
doc/build
@ -15,3 +16,6 @@ doc/source/_build
.tox
env
.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 && \
apt-get remove -y subversion
ADD requirements.txt 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 README.rst /surveil/README.rst
ADD etc/surveil /etc/surveil
ADD surveil /surveil/surveil
#ADD .git /surveil/.git
ENV PBR_VERSION=DEV
ENV PBR_VERSION=PROD
# Surveil API
EXPOSE 8080
# We are using develop so that the code can be mounted when in DEV.
RUN cd surveil && python setup.py develop
CMD cd /surveil/ && \
python setup.py develop && \
((sleep 40 && surveil-init) &) && \
sleep 20 && \
surveil-api --reload
CMD surveil-api

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