Last active
December 4, 2016 17:15
-
-
Save dmitryrck/c82f7e1076442a6aa79a57ad37f0031c to your computer and use it in GitHub Desktop.
Sample of Dockerfile and docker-compose.yml
This file contains 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
version: "2" | |
services: | |
db: | |
image: postgres | |
volumes: | |
- /var/lib/postgresql/data | |
expose: | |
- '5432' | |
web: | |
build: . | |
volumes: | |
- .:/app | |
ports: | |
- "3000:3000" | |
links: | |
- db |
This file contains 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
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