version: '3.1'

services:

  wordpress:
    image: wordpress
    ports:
      - 8888:80
    environment:
      WORDPRESS_DB_PASSWORD: example
      ABSPATH: /usr/src/wordpress/
    volumes:
      - wordpress:/var/www/html
      - .:/var/www/html/wp-content/plugins/qcformbuilder-forms-query

  cli:
    image: wordpress:cli
    volumes:
      - wordpress:/var/www/html
      - .:/var/www/html/wp-content/plugins/qcformbuilder-forms-query

  mysql:
    image: mysql:5.7
    environment:
      MYSQL_ROOT_PASSWORD: example
      MYSQL_DATABASE: wordpress_test

  wordpress_phpunit:
    image: chriszarate/wordpress-phpunit
    environment:
      PHPUNIT_DB_HOST: mysql
    volumes:
      - .:/app
      - testsuite:/tmp

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

volumes:
  testsuite:
  wordpress:
