Skip to content

Instantly share code, notes, and snippets.

@imjching
Created March 4, 2016 07:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save imjching/ee5642c9f5df97652dba to your computer and use it in GitHub Desktop.
Save imjching/ee5642c9f5df97652dba to your computer and use it in GitHub Desktop.
Utilizing Docker's data-only container
# 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
# 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
#!/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