Local environment setup cleanups (follow-ups to #1752) - #1753
Merged
Conversation
…erfile Follow-ups to #1752 batching local-environment setup cleanups: - Add `npm run setup` (composer install + npm ci + workspace build) and collapse the separate Composer/npm readme steps into it. - Replace the destructive git-hooks step with `git config core.hooksPath`. - Auto-install the PHPUnit test suite on container start (new install-test-suite.sh entrypoint), removing the manual step, and align the container's yoast/phpunit-polyfills to ^4.0 (was ^1.0, vs composer's ^4.0). - Collapse `docker compose build --pull` + `up` into `docker compose up --build`. - Consolidate Dockerfile.php-fpm layers and add apt cleanup (no behavior change).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-ups to #1752, batching the safe local-environment setup cleanups from a review of
.docker/. Opened as a draft for review.Changes
1. One-command host setup (
package.json,.docker/readme.md)package.jsonhad noscriptsblock. Added:npm run setup→composer install+npm ci+npm run build --workspaces --if-presentnpm run build→ the workspace build aloneThe readme's separate "composer install" and "npm install / npm run build" steps collapse into a single
npm run setup. (npm cireplacesnpm installfor reproducible installs against the committed lockfile.)2. Non-destructive git hooks (
.docker/readme.md)rm -rf .git/hooks && ln -s .githooks .git/hooks→git config core.hooksPath .githooks(git ≥ 2.9). One command, doesn't delete the hooks dir.3. PHPUnit test suite auto-installs (
.docker/Dockerfile.phpunit, new.docker/bin/install-test-suite.sh,.docker/readme.md)install-wp-tests.sh" step.yoast/phpunit-polyfills:^1.0whilecomposer.jsonrequires^4.0— now aligned.4. Single Docker boot command (
.docker/readme.md)docker compose build --pull+docker compose up→docker compose up --build.6.
Dockerfile.php-fpmimage hygiene (no behavior change)Same packages, extensions, and config — just consolidated the ~18 layers into a handful, added
--no-install-recommends+apt-get clean+rm -rf /var/lib/apt/lists/*, and&&-chained the wkhtmltopdf / WP-CLI / php.ini steps so intermediate artifacts (the wkhtmltox tarball) don't bloat a layer. Mirrors the cleanup patternDockerfile.phpunitalready uses.Verification
package.jsonis valid JSON;npm run setup/buildresolve.bash -nclean on the new entrypoint script.docker build --checkclean on both Dockerfiles.docker buildof both images succeeds (exit 0). The php-fpm image smoke-tests clean: WP-CLI 2.12.0,gd/intl/mysqli/zip/opcacheloaded,memory_limit= 256M, msmtp + mailcatcher present. The phpunit image installsphpunit/phpunit 9.6.34+yoast/phpunit-polyfills 4.0.0(drift fixed).docker compose -f docker-compose.phpunit.yml upbefore merging.