-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:blonestar/wp-theme-vite-tailwind
- Loading branch information
Showing
3 changed files
with
112 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,28 @@ | ||
{ | ||
"name": "WordPress", | ||
|
||
"dockerComposeFile": "docker-compose.yml", | ||
"service": "wordpress", | ||
|
||
// Uncomment the appropriate line depending on plugin vs theme development. | ||
// This should match the active volume mount in docker-compose.yml | ||
//"workspaceFolder": "/var/www/html/wp-content/plugins/plugin-dev", | ||
"workspaceFolder": "/var/www/html/wp-content/themes/vite-tailwind-theme", | ||
|
||
// Set *default* container specific settings.json values on container create. | ||
"settings": { | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"php.suggest.basic": false // avoids duplicate autocomplete | ||
}, | ||
|
||
// Add the IDs of any extensions you want installed. | ||
"extensions": [ | ||
"felixfbecker.php-pack", | ||
"wordpresstoolbox.wordpress-toolbox", | ||
"johnbillion.vscode-wordpress-hooks" | ||
], | ||
|
||
// Sets up WordPress on container start. | ||
"postCreateCommand": ".devcontainer/wp-setup.sh", | ||
"remoteUser": "vscode" | ||
} |
This file contains 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,37 @@ | ||
version: '3' | ||
services: | ||
wordpress: | ||
build: ./ | ||
ports: | ||
- 8080:80 | ||
depends_on: | ||
- db | ||
environment: | ||
WORDPRESS_DB_HOST: db | ||
WORDPRESS_DB_USER: wp_user | ||
WORDPRESS_DB_PASSWORD: wp_pass | ||
WORDPRESS_DB_NAME: wordpress | ||
WORDPRESS_DEBUG: 1 | ||
links: | ||
- db | ||
volumes: | ||
#Swap the folder path for plugin vs theme development | ||
- wordpress:/var/www/html | ||
#- ../:/var/www/html/wp-content/plugins/plugin-dev | ||
- ../:/var/www/html/wp-content/themes/vite-tailwind-theme | ||
|
||
db: | ||
image: mariadb:10 | ||
environment: | ||
MYSQL_DATABASE: wordpress | ||
MYSQL_USER: wp_user | ||
MYSQL_PASSWORD: wp_pass | ||
MYSQL_RANDOM_ROOT_PASSWORD: '1' | ||
ports: | ||
- 3306:3306 | ||
volumes: | ||
- data:/var/lib/mysql | ||
|
||
volumes: | ||
wordpress: | ||
data: |
This file contains 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,47 @@ | ||
#! /bin/bash | ||
|
||
#Site configuration options | ||
SITE_TITLE="Dev Site" | ||
ADMIN_USER=admin | ||
ADMIN_PASS=password | ||
ADMIN_EMAIL="[email protected]" | ||
#Space-separated list of plugin ID's to install and activate | ||
PLUGINS="advanced-custom-fields" | ||
|
||
#Set to true to wipe out and reset your wordpress install (on next container rebuild) | ||
WP_RESET=true | ||
|
||
|
||
echo "Setting up WordPress" | ||
DEVDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
cd /var/www/html; | ||
if $WP_RESET ; then | ||
echo "Resetting WP" | ||
wp plugin delete $PLUGINS | ||
wp db reset --yes | ||
rm wp-config.php; | ||
fi | ||
|
||
if [ ! -f wp-config.php ]; then | ||
echo "Configuring"; | ||
wp config create --dbhost="db" --dbname="wordpress" --dbuser="wp_user" --dbpass="wp_pass" --skip-check; | ||
wp core install --url="http://localhost:8080" --title="$SITE_TITLE" --admin_user="$ADMIN_USER" --admin_email="$ADMIN_EMAIL" --admin_password="$ADMIN_PASS" --skip-email; | ||
wp plugin install $PLUGINS --activate | ||
#TODO: Only activate plugin if it contains files - i.e. might be developing a theme instead | ||
#wp plugin activate plugin-dev | ||
wp theme activate vite-tailwind-theme | ||
|
||
#Data import | ||
cd $DEVDIR/data/ | ||
for f in *.sql; do | ||
wp db import $f | ||
done | ||
|
||
cp -r plugins/* /var/www/html/wp-content/plugins | ||
for p in plugins/*; do | ||
wp plugin activate $(basename $p) | ||
done | ||
|
||
else | ||
echo "Already configured" | ||
fi |