-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Adds a dev container #4031
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
Closed
samruddhikhandale
wants to merge
5
commits into
WordPress:trunk
from
samruddhikhandale:contribute-a-dev-container
Closed
Adds a dev container #4031
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| // For format details, see https://aka.ms/devcontainer.json. | ||
| { | ||
| "name": "WordPress Core Development", | ||
| "dockerComposeFile": "docker-compose.yml", | ||
| "service": "wordpress", | ||
| "workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}", | ||
|
|
||
| // Features to add to the dev container. More info: https://containers.dev/features. | ||
| "features": { | ||
| "ghcr.io/devcontainers/features/common-utils:2": { | ||
| "username": "wordpress" | ||
| }, | ||
| "ghcr.io/devcontainers/features/node:1": { | ||
| "version": "14" | ||
| }, | ||
| "ghcr.io/devcontainers/features/docker-in-docker:2": {}, | ||
| "ghcr.io/devcontainers/features/git:1": {} | ||
| }, | ||
| "onCreateCommand": "sudo chmod +x .devcontainer/install-tools.sh && .devcontainer/install-tools.sh", | ||
| "postCreateCommand": "sudo chmod +x .devcontainer/setup.sh && .devcontainer/setup.sh", | ||
| "forwardPorts": [ | ||
| 8080 | ||
| ], | ||
| "remoteUser": "wordpress" | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| version: '3.1' | ||
|
|
||
| services: | ||
| wordpress: | ||
| image: wordpress | ||
| restart: always | ||
| ports: | ||
| - 8080:80 | ||
| environment: | ||
| WORDPRESS_DB_HOST: db | ||
| WORDPRESS_DB_USER: exampleuser | ||
| WORDPRESS_DB_PASSWORD: examplepass | ||
| WORDPRESS_DB_NAME: exampledb | ||
| volumes: | ||
| - ../src:/var/www/html | ||
|
|
||
| db: | ||
| image: mariadb | ||
| restart: always | ||
| environment: | ||
| MYSQL_DATABASE: exampledb | ||
| MYSQL_USER: exampleuser | ||
| MYSQL_PASSWORD: examplepass | ||
| MYSQL_RANDOM_ROOT_PASSWORD: '1' | ||
| volumes: | ||
| - db:/var/lib/mysql | ||
|
|
||
| volumes: | ||
| wordpress: | ||
| db: |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #!/bin/sh | ||
|
|
||
| set -eux | ||
|
|
||
| echo "Installing wp-cli..." | ||
| curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | ||
| sudo chmod +x wp-cli.phar | ||
| sudo mv wp-cli.phar /usr/local/bin/wp | ||
|
|
||
| # Copy the welcome message | ||
| sudo cp .devcontainer/welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #!/bin/sh | ||
|
|
||
| set -eux | ||
|
|
||
| if [ "${CODESPACE_NAME}" = "" ]; then | ||
| SITE_HOST="http://localhost:8080" | ||
| else | ||
| SITE_HOST="https://${CODESPACE_NAME}-8080.${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN}" | ||
| fi | ||
|
|
||
| # Install dependencies | ||
| cd /workspaces/wordpress-develop | ||
| npm install && npm run build:dev | ||
|
|
||
| # Install WordPress and activate the plugin/theme. | ||
| cd /var/www/html | ||
| echo "Setting up WordPress at $SITE_HOST" | ||
| wp core install --url="$SITE_HOST" --title="WordPress Trunk" --admin_user="admin" --admin_email="admin@example.com" --admin_password="password" --skip-email |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| π Welcome to "WordPress Core Development" in Codespaces! | ||
|
|
||
| π οΈ Your environment is fully setup with all the required software. | ||
|
|
||
| π To get started, wait for the "postCreateCommand" to finish setting things up, then open the portforwarded URL and append '/wp-admin'. | ||
|
|
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.