All Projects → chriszarate → Docker Compose Wordpress

chriszarate / Docker Compose Wordpress

An example Docker Compose setup for WordPress plugin or theme development.

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Docker Compose Wordpress

Wordpress Starter
📦 A starter template for WordPress websites
Stars: ✭ 26 (-79.53%)
Mutual labels:  wp-cli, wordpress, docker-compose
Wordpress Nginx Docker Compose
Run WordPress with nginx using Docker Compose.
Stars: ✭ 460 (+262.2%)
Mutual labels:  wp-cli, wordpress, docker-compose
Docker Wordpress
WordPress container with Nginx 1.16 & PHP-FPM 7.3 based on Alpine Linux
Stars: ✭ 148 (+16.54%)
Mutual labels:  wp-cli, wordpress, docker-compose
Wordup Cli
Wordup is a fully integrated development platform for WordPress. Develop plugins and themes locally. Preview in the cloud. Automatic updates in WP.
Stars: ✭ 116 (-8.66%)
Mutual labels:  wp-cli, wordpress, docker-compose
Wordpress Multi Env Config
WordPress Multi-Environment Config
Stars: ✭ 743 (+485.04%)
Mutual labels:  wp-cli, wordpress
Docker4wordpress
Docker-based WordPress stack
Stars: ✭ 607 (+377.95%)
Mutual labels:  wordpress, docker-compose
Ddev
DDEV-Local: a local PHP development environment system
Stars: ✭ 915 (+620.47%)
Mutual labels:  wordpress, docker-compose
Wp Cli Replicator
Replicate production websites from WordPress eXtended RSS (WXR) export files
Stars: ✭ 34 (-73.23%)
Mutual labels:  wp-cli, wordpress
Wordpress To Jekyll Exporter
One-click WordPress plugin that converts all posts, pages, taxonomies, metadata, and settings to Markdown and YAML which can be dropped into Jekyll
Stars: ✭ 951 (+648.82%)
Mutual labels:  wp-cli, wordpress
Vccw
A Vagrant based development environment.
Stars: ✭ 1,012 (+696.85%)
Mutual labels:  wp-cli, wordpress
Wp Cli Fixtures
Easily generate custom fake data for WordPress
Stars: ✭ 65 (-48.82%)
Mutual labels:  wp-cli, wordpress
Wordpress Nginx Docker
Wordpress (php7.3-fpm) using Nginx and MariaDB - deployed with docker-compose - Let's Encrypt enabled
Stars: ✭ 498 (+292.13%)
Mutual labels:  wordpress, docker-compose
Wocker
Create your WordPress development environment in 3 SECONDS!
Stars: ✭ 482 (+279.53%)
Mutual labels:  wp-cli, wordpress
Wp Cli
⚙️ WP-CLI framework
Stars: ✭ 4,474 (+3422.83%)
Mutual labels:  wp-cli, wordpress
Wordpress Docker Compose
Easy Wordpress development with Docker and Docker Compose
Stars: ✭ 1,107 (+771.65%)
Mutual labels:  wordpress, docker-compose
Ext
WP-CLI command which checks the existence of PHP extensions needed to run WordPress.
Stars: ✭ 69 (-45.67%)
Mutual labels:  wp-cli, wordpress
Wp Vps Build Guide
A verbose build guide for a modern, high-performance WordPress production VPS.
Stars: ✭ 31 (-75.59%)
Mutual labels:  wp-cli, wordpress
Airplane Mode
Disables external data calls and loading for working on a purely local (i.e. no internet connection) WordPress site
Stars: ✭ 441 (+247.24%)
Mutual labels:  wp-cli, wordpress
Wuxt
Nuxt/WordPress development environment, combining the worlds biggest CMS with the most awesome front-end application framework yet.
Stars: ✭ 459 (+261.42%)
Mutual labels:  wordpress, docker-compose
Wp Skateboard
My local WordPress development built with Docker and Docker Compose.
Stars: ✭ 46 (-63.78%)
Mutual labels:  wordpress, docker-compose

WordPress plugin or theme development with Docker Compose

Build status

This is an example repo for how one might wire up Docker Compose for local plugin or theme development. It provides WordPress, MariaDB, WP-CLI, PHPUnit, and the WordPress unit testing suite.

Set up

  1. Clone or fork this repo.

  2. Put your plugin or theme code in the root of this folder and adjust the services/wordpress/volumes section of docker-compose.yml so that it syncs to the appropriate directory.

  3. Add project.test to /etc/hosts, e.g.:

    127.0.0.1 localhost project.test
    

Start environment

docker-compose up -d

The first time you run this, it will take a few minutes to pull in the required images. On subsequent runs, it should take less than 30 seconds before you can connect to WordPress in your browser. (Most of this time is waiting for MariaDB to be ready to accept connections.)

The -d flag backgrounds the process and log output. To view logs for a specific container, use docker-compose logs [container], e.g.:

docker-compose logs wordpress

Please refer to the Docker Compose documentation for more information about starting, stopping, and interacting with your environment.

Install WordPress

docker-compose run --rm wp-cli install-wp

Log in to http://project.test/wp-admin/ with wordpress / wordpress.

Alternatively, you can navigate to http://project.test/ and manually perform the famous five-second install.

WP-CLI

You will probably want to [create a shell alias][3] for this:

docker-compose run --rm wp-cli wp [command]

Running tests (PHPUnit)

The tests in this example repo were generated with WP-CLI, e.g.:

docker-compose run --rm wp-cli wp scaffold plugin-tests my-plugin

This is not required, however, and you can bring your own test scaffold. The important thing is that you provide a script to install your test dependencies, and that these dependencies are staged in /tmp.

The testing environment is provided by a separate Docker Compose file (docker-compose.phpunit.yml) to ensure isolation. To use it, you must first start it, then manually run your test installation script. These commands work for this example repo, but may not work for you if you use a different test scaffold.

Note that, in the PHPUnit container, your code is mapped to /app.

docker-compose -f docker-compose.yml -f docker-compose.phpunit.yml up -d
docker-compose -f docker-compose.phpunit.yml run --rm wordpress_phpunit /app/bin/install-wp-tests.sh wordpress_test root '' mysql_phpunit latest true

Now you are ready to run PHPUnit. Repeat this command as necessary:

docker-compose -f docker-compose.phpunit.yml run --rm wordpress_phpunit phpunit

Changing the hostname

You can change the hostname from the default project.test by adding a .env file at the project root and defining the DOCKER_DEV_DOMAIN environment variable:

DOCKER_DEV_DOMAIN=myproject.test

Seed MariaDB database

The mariadb image supports initializing the database with content by mounting a volume to the database container at /docker-entrypoint-initdb.d. See the MariaDB Docker docs for more information.

Troubleshooting

If your stack is not responding, the most likely cause is that a container has stopped or failed to start. Check to see if all of the containers are "Up":

docker-compose ps

If not, inspect the logs for that container, e.g.:

docker-compose logs wordpress
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].