version: '3'

services:
   db:
     ports:
       - "8001:3306"
     image: mysql:5.7
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: wordpress
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: wordpress

   web:
     depends_on:
       - db
     build:
       context: .
       dockerfile: Dockerfile
       args:
         woocommerce_version: 4.0.1
     ports:
       - "8000:80"
     restart: always
     environment:
       WORDPRESS_DEBUG: 1
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_PASSWORD: wordpress
       WORDPRESS_CONFIG_EXTRA: |
        define('WP_SITEURL', 'http://' . $$_SERVER['HTTP_HOST']);
        define('WP_HOME', 'http://' . $$_SERVER['HTTP_HOST']);
     volumes:
        - .:/var/www/html/wp-content/plugins/komoju-woocommerce
volumes:
    db_data:

version: '3'

services:
   db:
     ports:
       - "8001:3306"
     image: mysql:5.7
     volumes:
       - db_data:/var/lib/mysql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: wordpress
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: wordpress

   web:
     depends_on:
       - db
     build:
       context: .
       dockerfile: Dockerfile
       args:
         woocommerce_version: 4.0.1
     ports:
       - "8000:80"
     restart: always
     environment:
       WORDPRESS_DEBUG: 1
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_PASSWORD: wordpress
       WORDPRESS_CONFIG_EXTRA: |
        define( 'WP_DEBUG_LOG', '/tmp/wp-errors.log');
        define( 'WP_SITEURL', 'http://' . $$_SERVER['HTTP_HOST']);
        define( 'WP_HOME', 'http://' . $$_SERVER['HTTP_HOST']);
     volumes:
        - .:/var/www/html/wp-content/plugins/komoju-woocommerce
volumes:
    db_data:

Add WP_DEBUG_LOG option to WP config
Add WP_DEBUG_LOG option to WP config

Because the webhook response is coming out of the regular user driven
flow of the website, we need to enable logging to file to be able to see
any PHP errors that occur processing the webhook request. Specifically
setting the log file to be the /tmp directory because the default
directory is wp-content, which is controlled by root and the WP user
doesn't have permissions to write there.
