Skip to content

Commit

Permalink
Package Brain in a Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
benlangfeld committed Sep 8, 2014
1 parent 179734a commit 5b768db
Show file tree
Hide file tree
Showing 18 changed files with 204 additions and 5 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
ci: run_tests prep_deployment_config
ci: build_docker_images run_tests

build_docker_images:
docker build -t mojolingo/adam-snark-rabbit-basic-brain brain

run_tests:
STANDALONE_DEPLOYMENT=true kitchen test
docker run -i mojolingo/adam-snark-rabbit-basic-brain /bin/bash -c "cd /app && bin/test"

# Create chef solo config for deployment environments
prep_deployment_config:
Expand Down
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
memory: bin/memory
brain: bin/brain
brain: brain/bin/run
2 changes: 0 additions & 2 deletions bin/brain

This file was deleted.

1 change: 1 addition & 0 deletions brain/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor/ruby
17 changes: 17 additions & 0 deletions brain/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ubuntu:14.04

MAINTAINER Mojo Lingo LLC <[email protected]>

RUN apt-get update
RUN apt-get install -y software-properties-common
RUN apt-add-repository ppa:brightbox/ruby-ng
RUN apt-get update

RUN LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y libpcre3 libpcre3-dev libxml2 libxslt1-dev ruby2.1 ruby2.1-dev build-essential
RUN gem install bundler

ADD . /app

RUN cd /app && bundle install --deployment

CMD /app/bin/run
16 changes: 16 additions & 0 deletions brain/bin/ahn
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'ahn' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('adhearsion', 'ahn')
16 changes: 16 additions & 0 deletions brain/bin/autospec
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'autospec' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('rspec-core', 'autospec')
16 changes: 16 additions & 0 deletions brain/bin/coderay
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'coderay' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('coderay', 'coderay')
16 changes: 16 additions & 0 deletions brain/bin/guard
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'guard' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('guard', 'guard')
16 changes: 16 additions & 0 deletions brain/bin/htmldiff
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'htmldiff' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('diff-lcs', 'htmldiff')
16 changes: 16 additions & 0 deletions brain/bin/ldiff
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'ldiff' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('diff-lcs', 'ldiff')
16 changes: 16 additions & 0 deletions brain/bin/nokogiri
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'nokogiri' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('nokogiri', 'nokogiri')
16 changes: 16 additions & 0 deletions brain/bin/pry
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'pry' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('pry', 'pry')
16 changes: 16 additions & 0 deletions brain/bin/rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'rake' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('rake', 'rake')
16 changes: 16 additions & 0 deletions brain/bin/rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'rspec' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('rspec-core', 'rspec')
2 changes: 2 additions & 0 deletions brain/bin/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
exec bin/ahn start . --no-console
2 changes: 2 additions & 0 deletions brain/bin/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
exec bin/rake
16 changes: 16 additions & 0 deletions brain/bin/thor
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env ruby
#
# This file was generated by Bundler.
#
# The application 'thor' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'pathname'
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
Pathname.new(__FILE__).realpath)

require 'rubygems'
require 'bundler/setup'

load Gem.bin_path('thor', 'thor')

0 comments on commit 5b768db

Please sign in to comment.