Create a gist now

Instantly share code, notes, and snippets.

@tcnksm /Dockerfile
Last active Aug 29, 2015

What would you like to do?
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