Add Docker development environment

Multistage Dockerfile (WooCommerce download, wp-bootstrap npm build,
Composer deps, WordPress runtime), Compose stack with MariaDB, and
auto-setup entrypoint that installs WordPress and activates the theme
on first boot.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 11:59:20 +01:00
parent 404f3a7264
commit 624de0cae6
10 changed files with 270 additions and 0 deletions

View File

@@ -76,6 +76,13 @@ wc-bootstrap/
│ ├── notices/
│ ├── order/
│ └── single-product/
├── docker/
│ ├── Dockerfile # Multistage build (WC download, npm, composer, WP)
│ ├── entrypoint.sh # Auto-setup wrapper entrypoint
│ ├── setup.sh # First-run WP install + plugin/theme activation
│ └── .env-dist # Environment variable template
├── compose.yaml # WordPress + MariaDB services
├── compose.override.yaml # Dev overrides (bind mounts, debug flags)
├── composer.json
├── functions.php
└── style.css
@@ -95,6 +102,29 @@ WooCommerce wc_get_template("cart/cart.php")
→ Result: Bootstrap 5 Twig output only
```
### Docker Environment
```bash
# Copy and adjust environment variables (optional)
cp docker/.env-dist .env
# Build and start
docker compose build
docker compose up -d
# WordPress installs automatically on first boot (admin/admin)
# → http://localhost:8080
# → http://localhost:8080/wp-admin/
# Manual setup (if WP_AUTO_SETUP=0)
docker compose exec wordpress setup.sh
# Tear down
docker compose down -v
```
The image preinstalls WooCommerce and wp-bootstrap. The override bind-mounts both themes for live development.
### Building Translations
```bash