Skip to content

Instantly share code, notes, and snippets.

@tcnksm
Last active August 29, 2015 13:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tcnksm/9497916 to your computer and use it in GitHub Desktop.
Save tcnksm/9497916 to your computer and use it in GitHub Desktop.
Example of rbdock
FROM tcnksm/rails_base
FROM ubuntu
# Install basic dev tools
RUN apt-get update && apt-get install -y \
build-essential \
wget \
curl \
git
# Install package for ruby
RUN apt-get install -y \
zlib1g-dev \
libssl-dev \
libreadline-dev \
libyaml-dev \
libxml2-dev \
libxslt-dev
# Install package for sqlite3
RUN apt-get install -y \
sqlite3 \
libsqlite3-dev
# Install package for postgresql
RUN apt-get install -y libpq-dev
# Install ruby-build
RUN git clone https://github.com/sstephenson/ruby-build.git .ruby-build
RUN .ruby-build/install.sh
RUN rm -fr .ruby-build
# Install ruby-2.0.0-p247
RUN ruby-build 2.0.0-p247 /usr/local
# Install bundler
RUN gem update --system
RUN gem install bundler --no-rdoc --no-ri
# Add application
RUN mkdir /myapp
WORKDIR /myapp
ONBUILD ADD ./Gemfile /myapp/Gemfile
ONBUILD RUN bundle install
ONBUILD ADD ./ /myapp
ONBUILD ENTRYPOINT ["bash", "-l", "-c"]
ONBUILD CMD ["rake db:create && rake db:migrate && rails server"]
ENTRYPOINT ["bash", "-l", "-c"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment