Skip to content

Commit

Permalink
swapped out ruby versions and simplified the docker-run process.
Browse files Browse the repository at this point in the history
  • Loading branch information
bowens-bambora committed Apr 28, 2016
1 parent 06cbdd0 commit 029b178
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 27 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
.git
.gitignore
.travis.yml
CHANGELOG.md
CONTRIBUTING.md
docker-compose.yml
Jenkinsfile
LICENSE
23 changes: 7 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
FROM ubuntu:trusty
FROM ruby:onbuild
EXPOSE 4567

RUN apt-get update
RUN apt-get install -yq ruby ruby-dev build-essential git npm
RUN gem install --no-ri --no-rdoc bundler
ADD Gemfile ./app/Gemfile
ADD Gemfile.lock ./app/Gemfile.lock
ADD Rakefile ./app/Rakefile
ADD api ./app/api
ADD source ./app/source
ADD config.rb ./app/config.rb
WORKDIR app
RUN apt-get update && apt-get install -y git
RUN gem install bundler
RUN bundle install

ENTRYPOINT ["bundle", "exec"]
CMD ["rake", "run", "port=8000"]

ENTRYPOINT ["rake"]
CMD ["run"]

# 1) Build: docker run devbamboracom rake build
# 2) Run: docker run devbamboracom
# or: docker run devbamboracom rake run port=8080
# to specify the port.
# 2) Run: docker run devbamboracom
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ gem 'middleman-syntax', '~> 2.0.0'
gem 'middleman-autoprefixer', '~> 2.4.4'
gem 'rouge', '~> 1.9.0'
gem 'redcarpet', '~> 3.3.2'
gem 'puma', '~> 3.4.0'

gem 'rake', '~> 10.4.2'
gem 'therubyracer', '~> 0.12.1', platforms: :ruby
2 changes: 2 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ GEM
tilt (~> 1.4.1)
padrino-support (0.12.5)
activesupport (>= 3.1)
puma (3.4.0)
rack (1.6.4)
rack-test (0.6.3)
rack (>= 1.0)
Expand Down Expand Up @@ -136,6 +137,7 @@ DEPENDENCIES
middleman-autoprefixer (~> 2.4.4)
middleman-gh-pages (~> 0.0.3)
middleman-syntax (~> 2.0.0)
puma (~> 3.4.0)
rake (~> 10.4.2)
redcarpet (~> 3.3.2)
rouge (~> 1.9.0)
Expand Down
15 changes: 4 additions & 11 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ require 'rake/clean'

CLOBBER.include('build')

task :dependencies do
puts "installing node-static"
sh "npm install -g node-static"
end

task :build_slate do
puts "building slate"
Expand All @@ -17,14 +13,11 @@ task :copy_swagger do
puts "copying swagger UI"
sh "cp build public -r"
sh "cp -r api public/api"
sh "find ."
end

task :run do
puts "static -a 0.0.0.0 -p "+ENV['port']
sh "static -a 0.0.0.0 -p "+ENV['port']
task :run_server do
sh "bundle install"
sh "ruby -run -ehttpd ./public -p4567"
end
task :run => [:build_slate, :copy_swagger, :run_server]

task :build => [:dependencies, :build_slate, :copy_swagger]

task :default => [:build]

0 comments on commit 029b178

Please sign in to comment.