Created
May 3, 2015 09:13
-
-
Save guiman/b097e9bf6c6a4c449404 to your computer and use it in GitHub Desktop.
Example dockerfile for rails app
This file contains hidden or 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
FROM ruby:2.2 | |
MAINTAINER Alvaro F. Lara <[email protected]> | |
ENV HOME /home/app | |
ENV RAILS_ENV development | |
EXPOSE 8080 | |
RUN useradd -m -s /bin/bash app | |
RUN apt-get update && apt-get install -y ca-certificates build-essential libmysqlclient-dev ruby-mysql | |
RUN gem install -N bundler | |
ADD . /home/app/ | |
WORKDIR /home/app | |
RUN bundle install | |
RUN ln -sf /config/database.yml $HOME/config/database.yml | |
RUN ln -sf $HOME/log /log | |
RUN echo '#!/bin/bash \n bundle exec rake db:migrate; bundle exec unicorn -c ./config/unicorn.rb -E RAILS_ENV' > /home/app/startup.sh; \ | |
chmod +x /home/app/startup.sh | |
CMD ["/home/app/startup.sh"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment