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
To run this, you just need to:
- Copy the
.env.example
to a.env
file. - Adjust the env variables.
- Run
./start.sh
It'll do some things:
- Will edit your system
/etc/hosts
so you'll be able to use https://wordpress.local for your WordPress - Will generate certificates with the Docker image alpine/mkcert
- Will insert the generated cert to your system "cert store".
That's it.
-
/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.
./.docker/wordpress/php/php.ini
: https://github.com/php/php-src/blob/master/php.ini-development
- https://hub.docker.com/_/wordpress
- https://hub.docker.com/_/mariadb
- https://hub.docker.com/_/phpmyadmin
- https://hub.docker.com/r/alpine/mkcert
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