Skip to content

Instantly share code, notes, and snippets.

@dmitryrck
Last active December 4, 2016 17:15
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 dmitryrck/c82f7e1076442a6aa79a57ad37f0031c to your computer and use it in GitHub Desktop.
Save dmitryrck/c82f7e1076442a6aa79a57ad37f0031c to your computer and use it in GitHub Desktop.
Sample of Dockerfile and docker-compose.yml
version: "2"
services:
db:
image: postgres
volumes:
- /var/lib/postgresql/data
expose:
- '5432'
web:
build: .
volumes:
- .:/app
ports:
- "3000:3000"
links:
- db
from ruby:2.3.0
env DEBIAN_FRONTEND noninteractive
run sed -i '/deb-src/d' /etc/apt/sources.list
run apt-get update
run apt-get install -y build-essential postgresql-client nodejs
env PHANTOMJS_VERSION 1.9.8
run wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -O- | tar xf
run ln -s /usr/local/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
workdir /tmp
copy Gemfile Gemfile
copy Gemfile.lock Gemfile.lock
run bundle install
workdir /app
cmd ["rails", "server", "-b", "0.0.0.0"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment