Skip to content

Instantly share code, notes, and snippets.

@kaiinui
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaiinui/6b76608dae1e450c0dd6 to your computer and use it in GitHub Desktop.
Save kaiinui/6b76608dae1e450c0dd6 to your computer and use it in GitHub Desktop.
FROM ubuntu:12.04
RUN apt-get update
RUN apt-get -qy install git vim tmux
RUN apt-get -qy install build-essential libpq-dev libv8-dev
RUN apt-get -qy install curl
RUN apt-get -qy install openssl libreadline-dev curl zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison libcurl4-openssl-dev
RUN adduser --disabled-password --home=/rails --gecos "" rails
RUN apt-get -qy install wget
RUN wget http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.1.tar.gz
RUN tar xzfv ruby-2.1.1.tar.gz
RUN cd ruby-2.1.1 ; ./configure
RUN cd ruby-2.1.1 ; make && make install
RUN apt-get install sqlite3 libsqlite3-dev
RUN gem install bundler
##Cache bundle install#################
WORKDIR /tmp
ADD ./Gemfile Gemfile
ADD ./Gemfile.lock Gemfile.lock
RUN bundle install
#######################################
ENV RAILS_ENV production
ENV SECRET_KEY_BASE 7afcb74d7269d98a6db1175083e88061cb3c81e0341216f9ad345c82b5d4800ac3a1ef665fb5c08487023094c23773f5c97767256c4ee4c7b15124f1903d756d
EXPOSE 3000
ADD ./ /var/www/rails
WORKDIR /var/www/rails
RUN rake assets:precompile
CMD ["rails", "server", "puma", "-p", "3000"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment