Skip to content

Commit

Permalink
Merge pull request #11 from rothgar/ruby-container
Browse files Browse the repository at this point in the history
Simplified dockerfile
  • Loading branch information
spajus committed Feb 13, 2015
2 parents 4414135 + ee3e08e commit 8de5363
Show file tree
Hide file tree
Showing 2 changed files with 451 additions and 27 deletions.
40 changes: 13 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,24 @@
# Hubot Control

FROM ubuntu:13.10
FROM ruby:2.0.0-onbuild

# install dependencies
RUN apt-get update && apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libpq-dev nodejs nodejs-legacy npm
RUN npm install -g coffee-script
RUN npm install -g hubot
# Install nodejs and npm
RUN curl -sL https://deb.nodesource.com/setup | bash -
RUN apt-get update && apt-get install -y nodejs
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

# install rbenv
RUN git clone https://github.com/sstephenson/rbenv.git /usr/local/rbenv
RUN git clone https://github.com/sstephenson/ruby-build.git /usr/local/rbenv/plugins/ruby-build
RUN echo '# rbenv setup' > /etc/profile.d/rbenv.sh
RUN echo 'export RBENV_ROOT=/usr/local/rbenv' >> /etc/profile.d/rbenv.sh
RUN echo 'export PATH="$RBENV_ROOT/bin:$PATH"' >> /etc/profile.d/rbenv.sh
RUN echo 'eval "$(rbenv init -)"' >> /etc/profile.d/rbenv.sh
RUN chmod +x /etc/profile.d/rbenv.sh
ENV RBENV_ROOT /usr/local/rbenv
ENV PATH /usr/local/rbenv/shims:/usr/local/rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Install hubot
RUN npm install -g coffee-script hubot
RUN apt-get clean && npm cache clean

# install ruby 2.0
RUN rbenv install 2.0.0-p451
RUN rbenv global 2.0.0-p451
RUN useradd -m hubot

# skip installing documentation
RUN echo 'gem: --no-rdoc --no-ri' >> /.gemrc

RUN gem install bundler && rbenv rehash

ADD . /usr/src/hubot-control
WORKDIR /usr/src/hubot-control
EXPOSE 3000

RUN bundle install --system && rbenv rehash
WORKDIR /usr/src/app
RUN chown -R hubot:hubot /usr/src/app

USER hubot
RUN RAILS_ENV=production bundle exec rake assets:precompile

EXPOSE 3000
CMD ["bundle", "exec", "unicorn", "-p", "3000", "-c", "./config/unicorn.rb", "-E", "production"]
Loading

0 comments on commit 8de5363

Please sign in to comment.