chore: update Dockerfile and docker-compose for local dev

This commit is contained in:
2026-09-13 17:21:42 +02:00
parent 22230d188b
commit 10a2f05c31
2 changed files with 25 additions and 6 deletions
+22 -4
View File
@@ -1,18 +1,36 @@
version: '3.8'
services:
db:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: wordpress_tests
tmpfs:
- /var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 5s
retries: 10
app:
build:
context: .
dockerfile: Dockerfile
depends_on:
db:
condition: service_healthy
volumes:
- .:/app
- composer-cache:/root/.composer/cache
environment:
- WP_TESTS_DIR=/tmp/wordpress-tests-lib
command: >
- WP_TESTS_DIR=/app/vendor/wp-phpunit/wp-phpunit
- WP_PHPUNIT__TESTS_CONFIG=/app/tests/wp-tests-config.php
entrypoint: >
sh -c "
composer install --no-interaction &&
if [ ! -f /app/tests/wp-tests-config.php ]; then
curl -sL https://github.com/WordPress/wordpress-develop/raw/master/wp-tests-config-sample.php > /tmp/wp-tests-config-sample.php &&
sed 's/youremptytestdbnamehere/wordpress_tests/' /tmp/wp-tests-config-sample.php | sed 's/yourusernamehere/root/' | sed 's/yourpasswordhere/root/' | sed 's/localhost/db/' > /app/tests/wp-tests-config.php
fi &&
composer test
"