Created
June 22, 2015 11:03
-
-
Save l4u/98d11d1620570ccfbf76 to your computer and use it in GitHub Desktop.
Rails Docker docker-compose cached gems
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
db: | |
image: postgres:9.4 | |
web: | |
build: . | |
command: bin/rails server --port 3000 --binding 0.0.0.0 | |
ports: | |
- "3000:3000" | |
links: | |
- db | |
volumes: | |
- .:/myapp |
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.2 | |
RUN apt-get update -qq && apt-get install -y build-essential | |
# for postgres | |
RUN apt-get install -y libpq-dev | |
# for nokogiri | |
RUN apt-get install -y libxml2-dev libxslt1-dev | |
# for a JS runtime | |
RUN apt-get install -y nodejs | |
# bundler | |
RUN gem install bundler && bundle config jobs 7 | |
# myapp | |
ENV APP_HOME /myapp | |
RUN mkdir $APP_HOME | |
WORKDIR $APP_HOME | |
ADD Gemfile $APP_HOME/ | |
ADD Gemfile.lock $APP_HOME/ | |
RUN bundle install | |
ADD Gemfile.tip $APP_HOME/ | |
RUN bundle install | |
ADD . $APP_HOME |
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
if File.exists?("Gemfile.tip") | |
eval_gemfile File.join(File.dirname(__FILE__), "Gemfile.tip") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment