Skip to content

Conversation

@Clorith
Copy link
Member

@Clorith Clorith commented Apr 3, 2022

Getting a convenient environment running quickly with sites built on Project Base has often been a matter of developers needing to find what works for them, which makes things very open and free, but for some, they just want something that's there, and that works.

The wp-env package solved this for single plugin, theme, or project setups that were built on a normal WordPress folder, but there was never a good direct solution for sites with composer based setups built on the Bedrock principles, that is, until now!

This PR introduces the bedrock-wp-env package, which allows any user with Docker installed the ability to quickly spin up a local environment with a simple call to npm run env start!

The environment is slightly opinionated, while at the same time being as flexible as possible. It uses Apache at its base, which should hopefully save any developers from needing to understand server configurations if plugins or themes require custom redirect rules, they should be able to just rely on WordPress rewrite engine to handle it for them, or to generate the hard written rules if needed.

A set of new files are required for this (but they are only needed locally, this is why they are added to the .gitignore file); Namely the index.php in the project root (there to prevent the Docker images from downloading WordPress core files in duplicate), and the .htaccess file within the web root folder (public/.htaccess in the case of Project Base).

To go along with the new possibility of a local environment, is a new documentation folder; The intent of which is two-fold:

  1. Avoid overloading the primary project readme file with a lot of examples and instructions.
  2. Provide the groundwork for a new documentation home for any technical documents within a project that are tied to the code, and not the project in general (which is often held elsewhere).

Clorith added 3 commits April 3, 2022 22:25
This introduced the `bedrock-wp-env` package to Project Base, which allows for a bedrock, or bedrock-style project setup access to a quick and handy local environment based on `wp-env`.
@stian-overasen
Copy link
Member

I'm not sure if we should default the database vars and local url to this new environment or leave them default for LocalWP thought.

@PeterBooker
Copy link
Contributor

I like this (more Docker!) and it works for me, but it is difficult for me to judge its usefulness as I use my own manual Docker setup.

It would be great if LocalWP users could test it and give feedback, would they use this instead?

Copy link
Member

@stian-overasen stian-overasen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Can we keep the same db config as LocalWP so we don't need to change .env when switching between this setup and LocalWP?
  2. Is @clorith/bedrock-wp-env being maintained? The last commit is from April '22.

@stian-overasen
Copy link
Member

Closing this (again) in favour of more modern approach in #575

@stian-overasen stian-overasen deleted the feature/local-environment branch September 30, 2025 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants