lucatironi/rails-5-api-docker

View on GitHub
docker-compose.yml

Summary

Maintainability
Test Coverage
version: '2.1'

volumes:
  store:
    driver: local
  bundle:
    driver: local

services:
  web:
    build: .
    ports:
      - 3000:3000
    volumes:
      - .:/app
      - bundle:/usr/local/bundle
    links:
      - db
    # Keep the stdin open, so we can attach to our app container's process and do things such as
    # byebug, etc:
    stdin_open: true
    # Enable sending signals (CTRL+C, CTRL+P + CTRL+Q) into the container:
    tty: true
    command: ./bin/start.sh
    environment: &app_env
      PORT: 3000
      DB_HOST: db
      DB_PORT: 5432
      DB_NAME: rails_docker_database
      DB_USER: postgres
      DB_PSWD: postgres
  db:
    image: postgres:latest
    ports:
      - 5432:5432
    volumes:
      - store:/var/lib/postgresql/data
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
      POSTGRES_DB: rails_docker_database