Permalink
Browse files

added docker build for doc-srv

  • Loading branch information...
pelger committed May 14, 2014
1 parent 9b5b544 commit 71704890bd880af6a9da5a4505d1c61702f5782f
Showing with 44 additions and 11 deletions.
  1. +9 −0 builddoc.sh
  2. +15 −0 docker/doc.dockerfile
  3. +6 −5 srv/doc-srv.js
  4. +1 −1 srv/hist-srv.js
  5. +1 −1 srv/real-srv.js
  6. +7 −0 start.sh
  7. +5 −4 web/index.js
View
@@ -0,0 +1,9 @@
+#!/bin/sh
+mkdir -p build/srv/doc/lib
+mkdir -p build/srv/doc/srv
+cp lib/* build/srv/doc/lib
+cp srv/doc-srv.js build/srv/doc/srv
+cp package.json build/srv/doc
+cp docker/doc.dockerfile build/srv/doc/Dockerfile
+cd build/srv/doc
+npm install
View
@@ -0,0 +1,15 @@
+# DOCKER-VERSION 0.3.4
+FROM ubuntu
+
+RUN echo "deb http://archive.ubuntu.com/ubuntu precise universe" >> /etc/apt/sources.list
+RUN apt-get update
+RUN apt-get install -y software-properties-common
+RUN apt-get install -y python-software-properties python g++ make
+RUN add-apt-repository -y ppa:chris-lea/node.js
+RUN apt-get update
+RUN apt-get install -y nodejs
+
+ADD .
+EXPOSE 3002
+CMD node /srv/doc-srv
+
View
@@ -1,9 +1,10 @@
-var redis_host = process.env.REDIS_HOST||'127.0.0.1'
-var beanstalk_host = process.env.BEANSTALK_HOST||'127.0.0.1'
+//var redis_host = process.env.REDIS_HOST||'127.0.0.1'
+//var beanstalk_host = process.env.BEANSTALK_HOST||'127.0.0.1'
require('seneca')()
- .use('jsonfile-store',{folder:'../data/doc'})
+// .use('jsonfile-store',{folder:'../data/doc'})
.use('../lib/doc.js')
- .listen({type:'queue',pin:{role:'doc',kind:'clock',cmd:'*'},host:beanstalk_host})
- .client({type:'pubsub',host:redis_host})
+ //.listen({type:'queue',pin:{role:'doc',kind:'clock',cmd:'*'},host:beanstalk_host})
+ //.client({type:'pubsub',host:redis_host})
+ .listen({port:9002})
View
@@ -3,5 +3,5 @@ var redis_host = process.env.REDIS_HOST||'127.0.0.1'
require('seneca')()
.use('level-store',{folder:'../data/hist'})
.use('../lib/hist.js')
- .listen({type:'pubsub',host:redis_host})
+// .listen({type:'pubsub',host:redis_host})
.listen({port:9000})
View
@@ -2,5 +2,5 @@ var redis_host = process.env.REDIS_HOST||'127.0.0.1'
require('seneca')()
.use('../lib/real.js')
- .listen({type:'pubsub',host:redis_host})
+// .listen({type:'pubsub',host:redis_host})
.listen({port:9001})
View
@@ -0,0 +1,7 @@
+#!/bin/sh
+cd srv
+nohup node doc-srv.js & > doc.log 2>&1
+nohup node hist-srv.js & > hist.log 2>&1
+nohup node real-srv.js & > real.log 2>&1
+cd ../web
+node index.js
View
@@ -9,14 +9,15 @@ var seneca = require('seneca')()
seneca
.use('../lib/api.js')
- .declare('../lib/doc.js')
- .declare('../lib/hist.js')
- .declare('../lib/real.js')
+ .use('../lib/doc.js')
+ .use('../lib/hist.js')
+ .use('../lib/real.js')
.client({port:9000,pin:{role:'hist',kind:'clock',cmd:'*'},host:web_host})
.client({port:9001,pin:{role:'real',kind:'clock',cmd:'*'},host:web_host})
+ .client({port:9002,pin:{role:'doc',kind:'clock',cmd:'*'},host:web_host})
- .client({type:'queue',pin:{role:'doc',kind:'clock',cmd:'*'},host:beanstalk_host})
+// .client({type:'queue',pin:{role:'doc',kind:'clock',cmd:'*'},host:beanstalk_host})
var kraken = require('kraken-js'),

0 comments on commit 7170489

Please sign in to comment.