xwp / wp-dev-lib

DEPRECATED. Common code used during development of WordPress plugins and themes
MIT License
279 stars 58 forks source link

Provide a Docker image #321

Open kasparsd opened 4 years ago

kasparsd commented 4 years ago

Fixes #322

Include a Docker container that can be used to run all tasks.

Projects using wp-dev-lib can now use the pre-build Docker image to run all tasks supported by this tool in an environment that includes all the required dependencies and tools:

To use the Docker image, add docker-compose.yml to your project:

version: '3.6'
services:
  wpdevlib:
    image: xwpco/wp-dev-lib:latest
    working_dir: /var/www/html
    volumes:
      - .:/var/www/html

and use the following command to run any composer or npm task in the container:

docker-compose run wpdevlib composer test

where composer test is the task to run, which can potentially call vendor/xwp/wp-dev-lib/scripts/pre-commit to run the dev-lib pre-commit hooks.