Dockerfile.rbenv 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. FROM ubuntu
  2. # MAINTAINER Someone <someone@example.com>
  3. # Update package list
  4. RUN apt-get update
  5. # Set environmental variables
  6. ENV HOME /root
  7. ENV RBENV_ROOT $HOME/.rbenv
  8. ENV RUBY_VERSION 1.9.3-p545
  9. ENV RUBYGEMS_VERSION 2.2.2
  10. ENV PATH $HOME/.rbenv/shims:$HOME/.rbenv/bin:$RBENV_ROOT/versions/$RUBY_VERSION/bin:$PATH
  11. # Install OS packages
  12. RUN apt-get install -y build-essential curl zlib1g-dev libreadline-dev libssl-dev libcurl4-openssl-dev git libmysqlclient-dev
  13. RUN git clone https://github.com/sstephenson/rbenv.git $HOME/.rbenv
  14. RUN git clone https://github.com/sstephenson/ruby-build.git $HOME/.rbenv/plugins/ruby-build
  15. # install & set global ruby version
  16. RUN rbenv install $RUBY_VERSION
  17. RUN rbenv global $RUBY_VERSION
  18. WORKDIR /usr/local/src
  19. RUN curl -O http://production.cf.rubygems.org/rubygems/rubygems-$RUBYGEMS_VERSION.tgz
  20. RUN tar -xvf rubygems-$RUBYGEMS_VERSION.tgz
  21. RUN cd rubygems-$RUBYGEMS_VERSION ; ruby setup.rb
  22. RUN gem install bundle
  23. RUN mkdir huginn
  24. WORKDIR huginn
  25. # Add Gemfiles and run bundle ahead of time
  26. # This way bundle does not have to rerun unless the Gemfile changes
  27. # It drastically speeds up rebuilds
  28. ADD Gemfile /usr/local/src/huginn/
  29. ADD Procfile /usr/local/src/huginn/
  30. ADD Gemfile.lock /usr/local/src/huginn/
  31. RUN bundle
  32. # Now add the rest of the source
  33. ADD . /usr/local/src/huginn/
  34. RUN rm -rf /usr/local/src/huginn/.env
  35. # Add the environmental variables this way so that the -e option can override them
  36. ENV DATABASE_HOST db
  37. ENV DATABASE_NAME huginn
  38. ENV DATABASE_USERNAME huginn
  39. # Expose the Rails port to the rest of the world
  40. EXPOSE 3000
  41. # Default command - optimized for upgradability
  42. CMD ["foreman", "start"]