version: '2'
services:
  api:
    container_name: doubtfire-api
    build: .
    command: rails s
    ports:
      - "127.0.0.1:3000:3000"
    volumes:
      - ../doubtfire-api:/doubtfire-api
    links:
      - web
    depends_on:
      - db
    environment:
      DATABASE_URL: 'doubtfire-db'

  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: grunt watchsvr
    ports:
      - "127.0.0.1:8000:8000"
    volumes:
      - ../doubtfire-web:/doubtfire-web

version: '2'
services:
  api:
    container_name: doubtfire-api
    build: .
    command: rails s
    ports:
      - "3000:3000"
    volumes:
      - ../doubtfire-api:/doubtfire-api
    links:
      - web
    depends_on:
      - db
    environment:
      DATABASE_URL: 'doubtfire-db'

  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: grunt watchsvr
    environment:
      DOUBTFIRE_DOCKER_MACHINE_IP: $DOUBTFIRE_DOCKER_MACHINE_IP
    ports:
      - "8000:8000"
    volumes:
      - ../doubtfire-web:/doubtfire-web

Update ports to map to 0.0.0.0 instead of localhost
CONFIG: Update ports to map to 0.0.0.0 instead of localhost
