Integrating docker support

This commit is contained in:
Fokko Driesprong
2015-06-22 21:17:07 +02:00
parent f4ad21a5d1
commit 1399b9fe3c
6 changed files with 40 additions and 3 deletions
+10
View File
@@ -0,0 +1,10 @@
FROM node:0.10.38-slim
MAINTAINER Nightscout
# Netcat is required to poll the database, so Nightscout starts when MongoDB is up and running
RUN apt-get update && apt-get -y install netcat
RUN npm install .
EXPOSE 1337
CMD ["sh", "docker/docker-start.sh"]
-2
View File
@@ -41,8 +41,6 @@ function create (env, ctx) {
var bundle = require('./bundle')();
app.use(bundle);
// Handle errors with express's errorhandler, to display more readable error messages.
// Handle errors with express's errorhandler, to display more readable error messages.
var errorhandler = require('errorhandler');
//if (process.env.NODE_ENV === 'development') {
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
cd ../
docker-compose -p nightscout_build -f docker/docker-compose.yml stop
docker-compose -p nightscout_build -f docker/docker-compose.yml rm --force -v
docker-compose -p nightscout_build -f docker/docker-compose.yml build
docker-compose -p nightscout_build -f docker/docker-compose.yml up
+20
View File
@@ -0,0 +1,20 @@
nightscout:
build: ../
links:
- database
- broker
ports:
- "1337:1337"
environment:
- MONGO_CONNECTION=mongodb://database/nightscout
- API_SECRET=mylittlesecret
- MQTT_MONITOR=mqtt://broker
- PORT=1337
database:
image: mongo:3.0.3
ports:
- "27017"
broker:
image: prologic/mosquitto
ports:
- "1883"
-1
View File
@@ -7,7 +7,6 @@ var consts = require('./lib/constants');
var fs = require('fs');
// Module to constrain all config and environment parsing to one spot.
function config ( ) {
/*
* First inspect a bunch of environment variables:
* * PORT - serve http on this port
+2
View File
@@ -1,3 +1,5 @@
#!/bin/sh
sudo apt-get update
sudo apt-get install -y python-software-properties python g++ make git
sudo add-apt-repository ppa:chris-lea/node.js