Last active
July 17, 2016 15:44
-
-
Save benoist/5077f30f2477dac19d21 to your computer and use it in GitHub Desktop.
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
FROM my/base | |
VOLUME ["/app/vendor/cache"] | |
ADD ./docker /app/docker | |
RUN if [ -f /app/docker/setup.sh ]; then /app/docker/setup.sh; fi | |
ADD Gemfile /app/Gemfile | |
ADD Gemfile.lock /app/Gemfile.lock | |
RUN bundle install | |
ADD . /app | |
RUN PRECOMPILE=true \ | |
SECRET_KEY_BASE=ABCDEFGHIJKLMNOPQRSTUVWXYZ01234 \ | |
RAILS_ENV=production \ | |
bundle exec rake assets:precompile --trace | |
EXPOSE 3000 | |
ENTRYPOINT ["/app/bin/entry"] |
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
FROM ubuntu:14.04 | |
RUN mkdir -p /build | |
WORKDIR /build | |
ADD . /build | |
RUN ./install_ruby.sh | |
RUN ./install_default_packages.sh | |
RUN ./install_bundler.sh | |
RUN mkdir -p /bundle | |
RUN mkdir -p /app | |
WORKDIR /app |
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
#!/bin/bash | |
if [ "$1" == "run_with_migration" ]; then | |
bundle exec rake db:create db:migrate | |
bundle exec rails s -b 0.0.0.0 | |
fi | |
if [ "$1" == "run" ]; then | |
bundle exec rails s -b 0.0.0.0 | |
fi | |
if [ "$1" == "sleep" ]; then | |
ruby -e 'while true; sleep 1; end' | |
fi | |
if [ "$1" == "be" ]; then | |
bundle exec "${@:2}" | |
fi |
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
~/base | |
~/base/Dockerfile #Dockerfile-Base | |
~/base/install_ruby.sh | |
~/base/install_default_packages.sh | |
~/base/install_bundler.sh | |
~/rails_app #normal rails application | |
~/rails_app/bin/entry #make sure to chmod +x the entry file | |
~/rails_app/Dockerfile #Dockerfile-App |
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
#!/bin/bash | |
echo 'gem: --no-ri --no-rdoc' > ~/.gemrc | |
gem install bundler -v 1.10.3 | |
bundle config --global path /bundle | |
bundle config --global --jobs 4 |
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
#!/bin/bash | |
set -e | |
apt-get -y install build-essential git libpq-dev libcurl3 libcurl3-gnutls libcurl4-openssl-dev nodejs htop vim curl |
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
#!/bin/bash | |
set -e | |
apt-get -y update | |
apt-get -y install python-software-properties | |
apt-get -y install software-properties-common | |
apt-add-repository -y ppa:brightbox/ruby-ng-experimental | |
apt-get -y update | |
apt-get -y install ruby2.1 ruby2.1-dev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment