Skip to content

Instantly share code, notes, and snippets.

@dmitryrck

dmitryrck/Dockerfile

Last active Dec 4, 2016
Embed
What would you like to do?
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