Docker Compose project to deploy development environment for WordPress. Configured to store database and files changes locally in project folder matching the purpose of completely storing project in github. Additionally empowered with database manage module and php upload config files.
- 📦 WordPress and phpmyadmin from the box
- 📧 Ready to use Local Email Testing tool – Mailhog
- 🗂️ Database and file changes storing in project folder
- 🚀 Commit changes to github repository
For development purpose only, don't use in production.
git clone https://github.com/dendrofen/docker-compose-wordpress-lamp.git
Run docker compose in cloned project folder
docker-compose up -d
Once docker-compose run completed, modules gonna create new folders in our project folder, wait untill it's over and you can perform changes to source code or manage WordPress admin side.
type | login | password |
---|---|---|
Regular | user | user |
Root | user | root |
After docker-compose run, next files structure would be created after WordPress initialized, next you can edit these files and folders to perform project changes.
Changes per this directory would be synced with docker container as normally called - volume persistance. Your changes would be live-synced with docker container and visa-versa.
.docker/uploads.ini file includes settings for php upload media limitations, and scripts processing.
❗️ Note: Reload the container to see changes (more in FAQs)
WordPress Must use plugins directory /wp-content/mu-plugins contains plugins mailhog-docker-support to provide Mailhog module support for WordPress. As far this is mu-plugin, so it run in WordPress by default. You can not disable this plugin, but just remove from your project.
❗️ Note: This plugin override settings of WordPress phpmailer
Database data files stored locally in mariadb project folder. All changes between database would be stored in this folder, so you are free to use this folder as database backup for container.
More info about commiting database state here or in FAQs
❗️ Note: Stop the container, before commiting database to github.
There is .gitignore file configured to remove these items from repository. See below question.
WordPress default themes and default plugins will appear in container each time docker-compose up command will be processed, because of WordPress latest version installation per each container construction. You can avoide such actions, using just docker-compose start and docker-compose stop. There is also .gitignore config to prevent these items to be commited.
Changes will appear after container restart:
docker-compose restart
Yes, and this is exactly what this repository is made for. There is small guide how to correctly push changes using this project stack.