-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from rothgar/ruby-container
Simplified dockerfile
- Loading branch information
Showing
2 changed files
with
451 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
Oops, something went wrong.