version: '2'
services:
  api:
    container_name: doubtfire-api
    build: .
    command: bash -c "if [ -f /doubtfire-api/tmp/pids/server.pid ]; then rm /doubtfire-api/tmp/pids/server.pid; fi && rails server"
    ports:
      - "3000:3000"
    volumes:
      - ../doubtfire-api:/doubtfire-api
    links:
      - web
    depends_on:
      - db
    environment:
      DATABASE_URL: 'postgresql://itig:d872$$dh@db:5432/doubtfire_dev'
      RAILS_ENV: 'development'

  db:
    container_name: doubtfire-db
    image: postgres
    ports:
      - "5432:5432"
    environment:
      POSTGRES_PASSWORD: d872$$dh
      POSTGRES_USER: itig

  web:
    container_name: doubtfire-web
    build: ../doubtfire-web
    command: npm start
    environment:
      DOUBTFIRE_DOCKER_MACHINE_IP: $DOUBTFIRE_DOCKER_MACHINE_IP
    ports:
      - "8000:8000"
      - "8080:8080"
    volumes:
      - ../doubtfire-web:/doubtfire-web

version: '2'
services:
  api:
    container_name: doubtfire-api
    build: .
    command: bash -c "if [ -f /doubtfire-api/tmp/pids/server.pid ]; then rm /doubtfire-api/tmp/pids/server.pid; fi && rails server -b 0.0.0.0"
    ports:
      - "3000:3000"
    volumes:
      - ../doubtfire-api:/doubtfire-api
    links:
      - web
    depends_on:
      - db
    environment:
      DATABASE_URL: 'postgresql://itig:d872$$dh@db:5432/doubtfire_dev'
      RAILS_ENV: 'development'

  db:
    container_name: doubtfire-db
    image: postgres
    ports:
      - "5432:5432"
    environment:
      POSTGRES_PASSWORD: d872$$dh
      POSTGRES_USER: itig

  web:
    container_name: doubtfire-web
    build: ../doubtfire-web
    command: npm start
    environment:
      DOUBTFIRE_DOCKER_MACHINE_IP: $DOUBTFIRE_DOCKER_MACHINE_IP
    ports:
      - "8000:8000"
      - "8080:8080"
    volumes:
      - ../doubtfire-web:/doubtfire-web

Add missing bind option to accept all connections
FIX: Add missing bind option to accept all connections

By default, Rails will only serve to localhost, which means
connections outside the docker VM will not be accepted.

The host needs to be able to connect, so bind to 0.0.0.0
