@PabloVallejo
@PabloVallejo_
An open platform for distributed applications
Dockerized, Production/Development
Dockerized, Development
From: https://speakerdeck.com/asm89/docker
Docker Toolbox
Folder structure
docker-rails/
├── app/
├── ...
├── bin/
├── config/
├── db/
├── Dockerfile
├── docker-compose.yml
├── Gemfile
└── config.ru
Docker setup files
db:
image: postgres:9.5.0
volumes:
- .:/tmp/data/
web:
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0
volumes:
- .:/code
ports:
- "3000:3000"
links:
- db
# Django server
# Share this folder
# Get Postgres image
docker-compose.yml
FROM ruby:2.3.1
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
RUN mkdir /app
WORKDIR /app
ADD Gemfile /app/Gemfile
ADD Gemfile.lock /app/Gemfile.lock
RUN bundle install
ADD . /app
# FROM: Get image from docker index
# RUN: Run commands inside container
Dockerfile
# Build project
docker-compose build
Compose commands
# Run project
docker-compose up