Created
August 27, 2013 02:09
-
-
Save itsderek23/6348922 to your computer and use it in GitHub Desktop.
Example Docker File to start a Rails app located in a local ./docker-rails directory.
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
# docker build -t="rails" . | |
FROM ubuntu:12.04 | |
RUN apt-get update | |
## MYSQL | |
RUN apt-get install -y -q mysql-client libmysqlclient-dev | |
## RUBY | |
RUN apt-get install -y -q ruby1.9.1 ruby1.9.1-dev rubygems1.9.1 irb1.9.1 build-essential libopenssl-ruby1.9.1 libssl-dev zlib1g-dev | |
## RAILS | |
RUN gem install rails --no-ri --no-rdoc | |
## For execjs - needs node | |
RUN apt-get install -y python-software-properties python python-setuptools ruby rubygems | |
RUN add-apt-repository ppa:chris-lea/node.js | |
RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list | |
RUN apt-get update | |
RUN apt-get install -y nodejs | |
## RAILS APP | |
ADD ./docker-rails /srv/docker-rails | |
RUN cd /srv/docker-rails;bundle install | |
EXPOSE 3000 | |
RUN easy_install supervisor | |
RUN echo_supervisord_conf > /etc/supervisord.conf | |
RUN printf "[include]\nfiles = /srv/docker-rails/Supervisorfile\n" >> /etc/supervisord.conf | |
CMD ["/usr/local/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment