Customize the Codespaces configuration file
The .devcontainer/devcontainer.json
file provided by WordPress VIP can be modified to customize the available features and settings of a codespace environment. Settings defined in the features
section of the file allow customers to optionally enable features such as Elasticsearch, Xdebug, Photon, and MailPit, or specify a version of PHP.
The codespace environment will detect when edits are made to devcontainer.json
. Codespaces will generate a prompt in the browser to rebuild the environment with the applied changes.
Note
Do not update the multisite
or the multisiteStyle
settings after a codespace environment has been created. To modify these settings, delete the existing codespace environment, edit the values in the configuration file, then create a new codespace environment.
Environment variables
Environment variables must be defined in .devcontainer/devcontainer.json
; they cannot be managed with VIP-CLI in the codespace environment. Define the name-value pairs of the environment variables within the containerEnv
property where it exists in the file.
Do not store passwords, secrets, or other sensitive data in .devcontainer/devcontainer.json
. Use encrypted secrets provided by GitHub Codespaces for storing sensitive data.
Visual Studio Code extensions
A default group of VS Code extensions are defined in the customizations
section of .devcontainer/devcontainer.json
. The list can be modified to add or remove VS Code extensions as it suits the preferences of the developer. Refer to the VS Code Marketplace for available extensions.
Settings Sync is a VS Code feature that allows configurations such as settings, keyboard shortcuts, snippets, extensions, and UI state to be synchronized across machines and instances of VS Code. If Settings Sync is enabled in a user’s VS Code, GitHub Codespaces will attempt to install the same set of extensions in its VS Code interface.
Last updated: April 17, 2024