This is a Docker Compose project that spins up a WordPress installation using Nginx, Mailhog, MariaDB, and New Relic. It includes WP-CLI for easy WordPress management.
The WordPress files are mounted to a folder called data
, and the database files are mounted to a folder called db_data
. When you stop the container, the data will not be deleted. They get only deleted if you bring the container down.
- Clone the repository:
git clone https://github.com/pluginslab/docker-wordpress
- Make the install script executable by typing 'chmod +x ./install.sh'. This script will automate parts of the installation process.
- Then, type './install <NAME_OF_SITE>' where name of site is the name of the website you're spinning up.
- Clone the repository:
git clone https://github.com/pluginslab/docker-wordpress
- Copy the .env.example file to a new file called .env:
cp .env.example .env
and change the necessary values - Run the command
docker-compose up -d
on the root of the project folder to start the container. - To install WordPress using WP-CLI, run the command
docker-compose exec wordpress bash
to open a shell inside the WordPress container, and then run WP-CLI commands as usual:wp core download --path=/var/www/html --allow-root
- After gaining shell access to the WordPress container, configure WordPress with database details:
wp core config --dbname=database --dbuser=user --dbpass=password --dbhost=mariadb --allow-root
- Open your browser and go to
http://localhost:8080
(or change8080
to match the port defined in yourdocker-compose.yml
file under 'ports'). - To access Mailhog, go to
http://localhost:8025
. - To stop the containers, run the command
docker-compose down
inside the root of the repo folder.
Reminder: You might need to adjust file permissions or ownership in your WordPress directory, depending on your system setup.
- Fork the repository.
- Create a new branch:
git checkout -b new-feature
. - Make your changes and commit them:
git commit -am 'Add new feature'
. - Push to the branch:
git push origin new-feature
. - Submit a pull request.
This project is licensed under the MIT License.