FROM ubuntu:14.04
MAINTAINER Andrew Martin "sublimino@gmail.com" ENV APT_PACKAGES curl build-essential wget git
ENV NPM_PACKAGES forever gulp http-server
ENV NODE_VERSION 0.10.29
# apt and npm installation
#
RUN apt-get update && apt-get install -y $APT_PACKAGES && \
  apt-get clean && \
  rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN curl https://cdn.rawgit.com/isaacs/nave/master/nave.sh > /bin/nave && \ chmod a+x /bin/nave && \
  nave usemain $NODE_VERSION;
RUN npm install -g $NPM_PACKAGES;
# configure private npm
#
ADD ./node_modules/cb-shared/npmrc /root/.npmrc
$ gulp <tab>
browserify fleet:restart test:functional
build fleet:start test:functional:remote
build-properties help test:functional:watch
build:watch less test:integration
default lint test:integration:remote
docker:build livereload test:integration:watch
...
FROM harbour.example.com/cb-baseimage:latest
MAINTAINER Andrew Martin "sublimino@gmail.com"
# create installation directory
#
RUN mkdir -p /opt/d2
WORKDIR /opt/d2
# add package.json and npm install
#
ADD package.json /opt/d2/
RUN HOME=/root npm install ADD ./bin /opt/d2/bin
ADD ./lib /opt/d2/lib
ADD ./test /opt/d2/test
ADD exemplary.crt /opt/d2/exemplary.crt EXPOSE 4000 ENTRYPOINT ["bin/server.js"]
redis:
 image: harbour.example.com/cb-nhs-redis:latest
 ports:
  - "6379:6379"
... nhs: Â build: .
 # image: harbour.example.com/cb-nhs:latest
 environment:
  - CBNHS_LOGLEVEL=debug
  - CBNHS_DBBUCKET=cb-api - CBNHS_PRE_AUTHENTICATE=0 ...
 ports:
  - "58000:8000"
 links:
  - redis
  - couchbase
  - api
redis:
 image: harbour.example.com/cb-nhs-redis:latest
 ports:
  - "6379:6379" nhs:
 build: .
 # image: harbour.example.com/cb-nhs:latest
 environment:
  ...
 ports:
  - "58000:8000"
 links:
  - redis
  - couchbase
  - api couchbase:
 image: harbour.example.com/cb-couchbase-server:latest
...
api:
 image: harbour.example.com/cb-api:latest
...
input {
 lumberjack {
  port => 54321
  codec => "json"
  ssl_certificate => "server.crt"
  ssl_key => "server.key"
 }
}
filter {
 mutate {
  remove_field => [ "__CURSOR", "__MONOTONIC_TIMESTAMP" ]
 }
 if [type] == "stdin" {
  mutate {
   # microsecs to millisecs
   gsub => [ "__REALTIME_TIMESTAMP", "\d{3}$", "" ]
  }
  date {
   match => [ "__REALTIME_TIMESTAMP", "UNIX_MS" ]
  }
 }
 # (continued on next slide...)
# (continued from last slide...) Â # if messages start and end with curly brace, interpret as json,
 # except messages from the logstash container, which do start and
 # end with curly brace and are NOT json!
 if [MESSAGE] =~ /^\{.*\}$/ and [_SYSTEMD_UNIT] !~ /^logstash/ {
  json {
   source => "MESSAGE"
   target => "json"
  }
 }
}
output {
 elasticsearch {
  host => "${ES_HOST}"
  port => ${ES_PORT}
  protocol => "http"
 }
}