Skip to content

Docker environment for WordPress development with PHP, Apache, phpMyAdmin and MariaDB.

License

Notifications You must be signed in to change notification settings

srbrunoferreira/docker-wordpress

Repository files navigation

docker-php-fpm-apache-phpmyadmin-mariadb

Docker environment with WordPress, PHP-FPM, Apache, phpMyAdmin and MariaDB

Use it to develop your plugin or to have a LAMP stack to test some code.

You'll have:

Wordpress at https://wordpress.local phpMyAdmin at https://wordpress.local:3022

Setup

To run this, you just need to:

  1. Copy the .env.example to a .env file.
  2. Adjust the env variables.
  3. Run ./start.sh

About start.sh

It'll do some things:

  1. Will edit your system /etc/hosts so you'll be able to use https://wordpress.local for your WordPress
  2. Will generate certificates with the Docker image alpine/mkcert
  3. Will insert the generated cert to your system "cert store".

That's it.

About the folders

  • /wordpress - stores settings for the WP service.

  • /phpmyadmin - stores settings for the phpmyadmin service.

  • /wp-logs - stores the Apache logs from the WP service.

  • /wp-plugins - it's where you put your plugins. Also, any plugins installed from WordPress will be present here.

  • /wp-themes - it's where you put your themes. Themes intalled from WordPress will be present here too.

Reference

Docker images used

Useful commands

Import database

docker exec -i mariadb_{.ENV_PREFIX} \
  mariadb \
  --user=root \
  --password=root \
  < ./database.sql

Export all database

docker exec -i mariadb_{.ENV_PREFIX} \
  mariadb-dump \
  --user=root \
  --password=root \
  --all-databases \
  > ./database.sql

About

Docker environment for WordPress development with PHP, Apache, phpMyAdmin and MariaDB.

Topics

Resources

License

Stars

Watchers

Forks