run batch in wordpress docker container

I am trying to run batch in wordpress official container.
In container I want to run very simple batch like below:

./wordpress_batch.php

  • Using docker environment variables in docker-compose run commands
  • Dockerfile versioning best practice
  • Elastic search with docker does not start
  • VBoxManage (LockMachine): Docker machine created by chef
  • How do share a directory with same name in the current directory with docker
  • Accessing kubernetes running inside docker in a guest OS from the host OS
  • define('BASEPATH', '/path/to/wordpress');
    require_once(BASEPATH . '/wp-load.php');
    
    # batch program start
    echo "batch test";
    var_dump($wpdb);
    

    But no output is shown.
    This code work in wordpress in host machine.
    What is wrong in docker container?
    Any ideas to run this code?

    Thanks.

    ./docker-compose.yml:

    version: "2"
    services:
        wordpress:
            build: containers/wordpress
            ports:
                - "9000:80"
            depends_on:
                - db
            environment:
                WORDPRESS_DB_HOST: "db:3306"
            env_file: .env
            volumes:
                - ./wordpress_batch:/var/batch/
        db:
            build: containers/db
            env_file: .env
            volumes:
                - db-data:/var/lib/mysql
    volumes:
        db-data:
            driver: local
    

    ./containers/db/Dockerfile:

    FROM mysql:latest
    

    ./containers/wordpress/Dockerfile:

    FROM wordpress:latest
    

    The way I ran the code:

    $ docker-compose run wordpress bash
    # root@97658bd14387:/var/batch# php wordpress_batch.php
    

  • Node Prerender Working on First Page Load - 500 Error on Subsequent Loads
  • Set PortBindings config for ContainerCreate function in golang sdk for docker api
  • Run Command Inside of Docker Container Using Ansible
  • Docker container name conflict conflict, but that container doesn't exist
  • How to make changes to the code inside a Docker Container?
  • docker sonarqube checkdependency plugin
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.