https://github.com/ghdj/woocker
🚀 Dockerized WordPress + WooCommerce development environment with Xdebug, WP-CLI, configurable PHP versions, and complete sample data.
https://github.com/ghdj/woocker
docker docker-compose php plugin-development woocommerce wordpress wordpress-plugin xdebug
Last synced: 3 months ago
JSON representation
🚀 Dockerized WordPress + WooCommerce development environment with Xdebug, WP-CLI, configurable PHP versions, and complete sample data.
- Host: GitHub
- URL: https://github.com/ghdj/woocker
- Owner: GhDj
- Created: 2025-10-26T21:51:53.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-10-27T00:21:21.000Z (3 months ago)
- Last Synced: 2025-10-27T00:33:51.849Z (3 months ago)
- Topics: docker, docker-compose, php, plugin-development, woocommerce, wordpress, wordpress-plugin, xdebug
- Language: Shell
- Homepage:
- Size: 15.6 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# WordPress + WooCommerce Development Environment
A complete Dockerized development environment for WordPress and WooCommerce plugin development, ready for testing and debugging.
## Features
- ✅ WordPress with WooCommerce pre-installed
- ✅ Storefront theme (WooCommerce's official theme)
- ✅ Sample products of all WooCommerce product types
- ✅ Xdebug configured for step-by-step debugging
- ✅ PHPUnit ready for unit and integration testing
- ✅ MySQL database with PHPMyAdmin
- ✅ Fully configurable via `.env` file
- ✅ Local plugin development with live sync
## Prerequisites
- Docker Desktop installed and running
- Docker Compose v2.0+
- Git
- 4GB+ RAM available for Docker
## Quick Start
```bash
# Run the automated setup
./setup.sh
```
That's it! The setup script will:
- Create environment configuration
- Build Docker containers with your chosen PHP version
- Install WordPress
- Install and configure WooCommerce
- Install Storefront theme
- Create sample products (all product types)
- Create sample customers
- Configure Xdebug for debugging
## Access Your Site
After setup completes:
- **Frontend**: http://wooco.localhost:8000 (or your configured hostname)
- **Admin**: http://wooco.localhost:8000/wp-admin
- **PHPMyAdmin**: http://localhost:8080
**Default Login:**
- Username: `admin`
- Password: `admin123`
**Note:** `*.localhost` domains work without editing `/etc/hosts` on most systems. You can customize the hostname in `.env`.
## Project Structure
```
woocker/
├── setup.sh # Automated setup script
├── docker-compose.yml # Docker services configuration
├── Dockerfile # WordPress container with Xdebug
├── .env # Environment variables (create from .env.example)
├── .env.example # Environment template
├── .gitignore # Git ignore rules
├── wordpress/ # Full WordPress installation (mounted)
│ ├── wp-admin/ # WordPress admin
│ ├── wp-includes/ # WordPress core
│ ├── wp-content/
│ │ ├── plugins/ # Your custom plugins go here
│ │ │ └── your-plugin/
│ │ │ ├── your-plugin.php
│ │ │ ├── tests/ # Plugin-specific tests
│ │ │ └── phpunit.xml
│ │ ├── themes/ # WordPress themes
│ │ └── uploads/ # Media uploads
│ └── wp-config.php # WordPress configuration
└── scripts/
└── setup-sample-data.sh
```
## Plugin Development
### Adding Your Plugin
The entire WordPress installation is in the `./wordpress/` directory and is synchronized with the Docker container in real-time.
1. Create your plugin directory:
```bash
mkdir -p wordpress/wp-content/plugins/my-plugin
```
2. Create your main plugin file:
```bash
cat > wordpress/wp-content/plugins/my-plugin/my-plugin.php <
./tests
```
3. **Create `tests/bootstrap.php`:**
```php