version: '3'

services:

  vtiger:
    image: javanile/vtiger:7.0.0
    environment:
      - VT_DEBUG=false
      - MYSQL_HOST=mysql
      - MYSQL_DATABASE=vtiger
      - MYSQL_ROOT_PASSWORD=secret
    ports:
      - "48080:80"
    volumes:
      - ./:/app
      - ./volumes/logs:/var/www/html/logs
      - ./volumes/storage:/var/www/html/storage
    links:
      - mysql
      - adminer

  mysql:
    image: mysql:5.5
    environment:
      - MYSQL_DATABASE=vtiger
      - MYSQL_ROOT_PASSWORD=secret
    volumes:
      - mysql:/var/lib/mysql:rw

  adminer:
    image: javanile/adminer
    environment:
      - MYSQL_DATABASE=vtiger
      - MYSQL_ROOT_PASSWORD=secret
    ports:
      - "48081:8080"

  composer:
    image: composer
    volumes:
      - ./:/app

  phpunit:
    image: phpunit/phpunit:6.5.3
    environment:
      - VT_ENDPOINT=http://vtiger
      - VT_USERNAME=admin
      - MYSQL_HOST=mysql
      - MYSQL_DATABASE=vtiger
      - MYSQL_ROOT_PASSWORD=secret
    volumes:
      - ./:/app
    links:
      - vtiger

volumes:
  mysql:
