Skip to content

Instantly share code, notes, and snippets.

@naderio
Created January 22, 2018 23:22
Show Gist options
  • Save naderio/2eee22118e641fb741e56f1ca2826fe6 to your computer and use it in GitHub Desktop.
Save naderio/2eee22118e641fb741e56f1ca2826fe6 to your computer and use it in GitHub Desktop.
Ruby on Rails Docker Development Setup
version: '2.3'
services:
postgres:
image: postgres:9.6
hostname: postgres
ports:
- "5432:5432"
volumes:
- "./tmp:/var/lib/postgresql/data"
environment:
POSTGRES_USER: placeholder
POSTGRES_PASSWORD: placeholder
version: '2.3'
services:
placeholder-app:
build: .
container_name: placeholder-app
hostname: placeholder-app
ports:
- "3000:80"
volumes:
- .:/app
environment:
- RAILS_ENV=development
- DATABASE_URL=postgres://placeholder:placeholder@172.17.0.1
- MAIL_URL=smtp://172.17.0.1:1025 # @TODO support
- ROOT_URL=http://localhost:3000 # @TODO support
FROM ruby:2.4.3
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev graphviz
RUN mkdir /app
WORKDIR /app
COPY . /app
RUN bundle install
ENV PORT=80
EXPOSE $PORT
CMD bin/rails server -b '0.0.0.0' -p $PORT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment