-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(dev-env): make wordpress
init-only container
#2143
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 2 out of 3 changed files in this pull request and generated no suggestions.
Files not reviewed (1)
- assets/dev-env.lando.template.yml.ejs: Language not supported
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files |
LANDO_NO_SCRIPTS: 1 | ||
LANDO_NEEDS_EXEC: 1 | ||
initOnly: true | ||
entrypoint: /usr/bin/rsync -a --chown=${LANDO_HOST_USER_ID}:${LANDO_HOST_GROUP_ID} /wp/ /shared/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${LANDO_HOST_USER_ID}
and ${LANDO_HOST_GROUP_ID}
will be taken directly from the environment; we don't need to spawn a shell to pass the values to the program.
Because the container is init-only, we don't need Lando scripts to manage permissions either; rsync
perfectly understands numeric IDs and does not require the presence of /etc/passwd
. This allows us to optimize WordPress images.
2d7c9d1
to
5c0d0f8
Compare
Tested under all platforms (except Linux), works as expected. |
5c0d0f8
to
386888f
Compare
Quality Gate passedIssues Measures |
Description
This PR updates the Dev Environment Lando template to make the
wordpress
service init-only (see #1341 for the background). Because we usewordpress
only to provide a volume with WordPress installation, we don't need the container after the initialization stage. Letting the container die peacefully will free up some memory and CPU and reduce the number of mount points.This PR and #2139 will let us merge the
dev-tools
andwordpress
services into one. We will also be able to replace the dependency condition forwordpress
fromservice_started
toservice_completed_successfully
; this will simplify the WordPress setup script because Docker will start thephp
service after WordPress files are copied to where they belong.Pull request checklist
New release checklist
Steps to Test
npm run build && npm link
.vip dev-env create < /dev/null && vip dev-env start
.vip dev-env logs -S wordpress
must show nothing because we bypass Lando.docker ps -a --no-trunc
must show the entry point for thewordpress
service as"/usr/bin/rsync -a --chown=1000:1000 /wp/ /shared/"
(with the UID and GID of the current user instead of 1000:1000).