Docker development setup for WooCommerce with WP-ENV.
## Prerequisites
Please install WP-ENV before getting started. You can find more about WP-ENV on [here](https://github.com/WordPress/gutenberg/tree/master/packages/env).
Please refer to [WP-ENV official README](https://github.com/WordPress/gutenberg/tree/master/packages/env#using-xdebug) section for setting up Xdebug.
## Overriding the Default Configuration
The default configuration comes with PHP 7.4, WooCommerce 5.0, and a few WordPress config values.
You can create `.wp-env.override.json` file and override the default configuration values.
You can find more about `.wp-env.override.json` configuration [here](https://github.com/WordPress/gutenberg/tree/master/packages/env#wp-envoverridejson).
**Example: Overriding PHP version to 8.0**
Create `.wp-env.override.json` in the root directory with the following content.
```json
{
"phpVersion": "8.0"
}
```
**Exampe: Adding a locally installed plugin**
Method 1 - Adding to the `plugins` array
Open the default `.wp-env.json` and copy `plugins` array and paste it into the `.wp-env.override.json` and add your locally installed plugin. Copying the default `plugins` is needed as WP-ENV does not merge the values of the `plugins`.
The MySQL port can change when you restart your container.
You can get the current MySQL port from the output of `wp-env start` command.
1. Open your choice of MySQL tool.
2. Use the following values to access the MySQL container.
3. You can omit the username and password.
| Name | Value |
| -------- | --------------------- |
| Host | 127.0.0.1 |
| Username | |
| Password | |
| Port | Port from the command |
## HOWTOs
##### How do I ssh into the container?
Run the following command to ssh into the container
`wp-env run wordpress /bin/bash`
You can run a command in the container with the following syntax. You can find more about on the `run` command [here](https://github.com/WordPress/gutenberg/tree/master/packages/env#wp-env-run-container-command)