Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Quickly creates a development environment for an existing WordPress site.

License

Notifications You must be signed in to change notification settings

lumonald/existing-wordpress-development-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Existing WordPress site development - Docker

Notice

Unfortunately I no longer have time to manage this project so it has been publicly archived.


Quickly creates a local development environment for an existing WordPress site.

This application requires Docker to be up and running and for docker compose to also be installed.

The docker-compose.yml file defines 2 containers -

  • wordpress - for the website files.
  • db - for the associated MySQL database.

The wordpress container has 2 volumes -

  1. The site/wp-content folder - Copy the wp-content folder from the production site. It's used for all customisations outside of the core WordPress code. This includes the themes, plugins, uploads etc.

  2. init/prep.sh - Disables plugins as defined in the .env file. It also makes the wp-content folder the same owner/group as the rest of the site.

Note: The wp-config.php file gets auto generated for this local WordPress instance.

The db container has 3 volumes -

  1. database - A folder for all of the MySQL files, this gets automatically generated by docker and can remain untouched for average usage.

  2. mysqldumps/backup.sql.gz - This is a snapshot taken from the production instance via mysqldump, place the file in this location and it will get imported on the first run of the container automatically.

  3. init/migrate.sh - A URL migration script, this updates the URL stored in the database, this also gets run automatically when the containers are spun up for the first time.

Usage

  1. Clone or download this project.

  2. Create a mysqldump from your pre-existing site and place in location: mysqldumps/backup.sql.gz (ensure file is named backup.sql.gz)

  3. Obtain copy of wp-content folder from pre-existing site and place in location: site/wp-content

  4. Enter your configuration variables into .env.

  5. Navigate to the root of this project locally and run:

    docker-compose up -d && docker-compose exec wordpress prep.sh

The website will then be available at http://localhost and the WordPress dashboard at http://localhost/wp-admin.

About

Quickly creates a development environment for an existing WordPress site.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages