8000 GitHub - WordspaceStudio/wp-docker: Docker environment for local WordPress development
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

WordspaceStudio/wp-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WordPress Docker Setup for Development

This setup is for local development only. DO NOT use in production.

Start Services

docker-compose up -d
Service Default URL
WordPress http://localhost:8000/
phpMyAdmin http://localhost:8001/
MailHog http://localhost:8025/
MariaDB localhost:3306

Mounted WP folder

Docker expects to find WordPress in a web/ folder. If it doesn't exist, it creates it and installs WordPress inside. Visit http://127.0.0.1:8000 to finish the database installation.

Helper executables

Use the ./wp to run WP CLI commands in the WordPress container.

Use the ./composer to run composer commands in the WordPress Container.

Database

phpMyAdmin is running on http://127.0.0.1:8001 and also port 3306 gets automatically bound to your host so you can connect with an SQL client.

Logs

Monitor the PHP logs from the WordPress container with:

docker logs -f $(docker-compose ps -q wp) >/dev/null

Debugging

Xdebug 3 is pre-configured for remote debugging with the IDE key PHPSTORM. See php.ini.

Multisite

For multisite support in sub-directory mode, add this to your .htaccess:

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

And this to your wp-config.php:

define('WP_ALLOW_MULTISITE', true);
define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', false);
define('DOMAIN_CURRENT_SITE', '127.0.0.1:8000');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);

About

Docker environment for local WordPress development

Resources

Stars

Watchers

Forks

Packages

No packages published
0