Skip to content

Basic Docker configuration for local WordPress development

License

Notifications You must be signed in to change notification settings

mdmoreau/docker-wp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-wp

Basic Docker configuration for local WordPress development

Includes

  • Apache
  • MariaDB
  • PHP
  • WP-CLI
  • phpMyAdmin

Dependencies

Configuration

  • The optional .env file serves as a template using default values
  • UID and GID: Set to the current operating system user values to avoid filesystem permission issues
  • WP_PORT and PMA_PORT: Override the default ports for WordPress and phpMyAdmin
  • A compatible wp-config.php will be generated if one does not already exist
  • The optional wp-config-local.php can be used for supported installs where wp-config.php is tracked

Usage

  • Add compose.yaml to the root of the local WordPress install
  • Start: docker compose up -d
  • Visit any localhost address (http://localhost, http://site.localhost, etc)
  • Stop: docker compose down

Features

WP-CLI

  • docker compose run --rm wp-cli [command]
  • [command] can be any WP-CLI command (--info, media regenerate, etc)

phpMyAdmin

Fallback asset loading

  • The optional .htaccess file can be used to automatically load missing assets from another URL
  • https://example.com can be changed to the live URL to avoid having to pull down assets for local development
  • These directives should always come before the WordPress block

About

Basic Docker configuration for local WordPress development

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages