Created
March 4, 2016 07:23
-
-
Save imjching/ee5642c9f5df97652dba to your computer and use it in GitHub Desktop.
Utilizing Docker's data-only container
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
# Main application | |
web: | |
container_name: rails_web | |
build: . | |
command: bash ./start.sh | |
volumes: | |
- .:/app | |
ports: | |
- "80:3000" | |
volumes_from: | |
- bundle_store | |
# Data-only container for bundler data | |
# create the volume by doing: docker volume create bundle_store | |
bundle_store: | |
container_name: rails_bundle_store | |
image: cogniteev/echo | |
command: echo 'Data Container for Bundler' | |
volumes: | |
- bundle_store:/usr/local/bundle |
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
# Choose the official Ruby 2.3.0 image as our starting point | |
FROM ruby:2.3.0 | |
# Run updates for nokogiri and JS runtime | |
RUN apt-get update -qq && apt-get install -y build-essential libxml2-dev libxslt1-dev nodejs | |
# Cleanup | |
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | |
# Set up working directory | |
RUN mkdir /app | |
WORKDIR /app | |
# Set up bundle environment | |
ENV BUNDLE_JOBS=3 BUNDLE_GEMFILE=/app/Gemfile |
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
#!/bin/bash | |
bundle check || bundle install | |
rm -f /app/tmp/pids/server.pid | |
rails s -b 0.0.0.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment