version: '3.8'

services:
  php:
    build:
      context: ./docker/php
    command: bash -c 'cd /project && composer install && php vendor/bin/codecept build -c tests/integration/ && php vendor/bin/codecept run -c tests/integration/ && vendor/bin/phpunit tests/unit/'
    volumes:
      - ./:/project
    depends_on:
      - phantomjs
      - httpserver
    network_mode: host
  phantomjs:
    build:
      context: ./docker
      dockerfile: phantomjs.docker
    command: bash -c 'phantomjs --webdriver=4444 --ignore-ssl-errors=true'
    ports:
      - '4444:4444'
  httpserver:
    build:
      context: ./docker
      dockerfile: httpServer.docker
    volumes:
      - ./tests/integration/html:/public
    ports:
      - '8080:8080'
