Skip to content

Instantly share code, notes, and snippets.

@getjump
Created October 26, 2015 02:26
Show Gist options
  • Save getjump/4a6202f39a956f849390 to your computer and use it in GitHub Desktop.
Save getjump/4a6202f39a956f849390 to your computer and use it in GitHub Desktop.
Docker Rails
db:
image: postgres
ports:
- "5432"
web:
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
volumes:
- .:/myapp
ports:
- "3000:3000"
links:
- db
FROM ruby:2.2.0
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev
RUN mkdir /myapp
WORKDIR /myapp
ADD Gemfile /myapp/Gemfile
RUN bundle install
ADD . /myapp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment