version: '3'
services:

  dev:
    build: .
    volumes:
      - .:/app
      # - ./vendor:/app/vendor
    ports:
      - "3000:3000"
    env_file:
      - test.env
      # - dev.env
    command: "tail -f /dev/null"
    depends_on:
      - setup_dbs

  test:
    build: .
    environment:
      RAILS_ENV: test
    env_file:
      - test.env
    command: "tail -f /dev/null"
    depends_on:
      - setup_dbs

  setup_dbs:
    build: .
    environment:
      GETIT_DB_HOST: db
    command: bash -c "sleep 5; rake db:setup"
    depends_on:
      - db

  db:
    image: library/mysql:5.6.22
    expose:
      - "3306"
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'

version: '3'
services:

  dev:
    build: .
    volumes:
      - .:/app
      # - ./vendor:/app/vendor
    ports:
      - "3000:3000"
    env_file:
      - test.env
      # - dev.env
    command: "tail -f /dev/null"
    depends_on:
      - setup_dbs

  test:
    build: .
    environment:
      RAILS_ENV: test
    env_file:
      - test.env
    command: "tail -f /dev/null"
    depends_on:
      - setup_dbs
      - phantomjs

  setup_dbs:
    build: .
    environment:
      GETIT_DB_HOST: db
    command: bash -c "sleep 5; rake db:setup"
    depends_on:
      - db

  db:
    image: library/mysql:5.6.22
    expose:
      - "3306"
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'

  # Use an external PhantomJS service for running tests
  # https://github.com/teampoltergeist/poltergeist#customization
  phantomjs:
    image: wernight/phantomjs:2.1.1
    expose:
      - "8910"

Build phantomjs as a separate container service
Build phantomjs as a separate container service
