Skip to content

Latest commit

 

History

History
121 lines (94 loc) · 2.42 KB

README.md

File metadata and controls

121 lines (94 loc) · 2.42 KB

Docker WordPress MariaDB PHPMyAdmin

A simple docker-compose.yml for WordPress development.

This is not secure. Don't use it on a production environment

Installation

Install docker:

Install docker-compose: multi-platform documentation

Launch the stack

Create your project directory:

git clone [email protected]:loichu/docker-wp-mariadb-phpmyadmin.git your-project-name
cd your-project-name

Run docker:

docker-compose up -d
  • -d means detach, the process will be detach of the tty (terminal)

Makefile alternative

This stack contains a Makefile. It requires having make installed. This provides some useful commands.

Launch the stack:

make up

Stop the stack:

make down

Fix permissions:

make perm

See all docker logs:

make logs

See MariaDB docker logs:

make logs-db

See WordPress docker logs:

make logs-wp

Connection

Find your WordPress website at http://localhost:8080.

Find your PHPMyAdmin at http://localhost:8181.

Credentials

DB root password: secret

DB WordPress user: wordpress

DB WordPress password: wordpress

Connect to PHPMyAdmin:

  • Server: db
  • User: root
  • Password: secret

Directory structure

  • db: Persistent volume to store MariaDB database.
  • wp: Persistent volume to store WordPress files.

Issues

Unable to edit files

make perm

cannot open 'wp/wp-content/debug.log' for reading: No such file or directory

Normally in wp/wp-config.php you should have near line 80 define('WP_DEBUG', true);. Replace it by the following:

// Show debug logs in wp-content/debug.log
define('WP_DEBUG', true);
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', true );

make logs-sql shows nothing

MariaDB has to restart to load the configuration file db-conf/enable-general-logs.cnf.

make down up

WordPress asks for a FTP server

Add the following line to wp-config.php:

// Don't download through FTP
define('FS_METHOD', 'direct');

Other commands

Stop the stack:

docker-compose down

Start the stack and see logs in terminal:

docker-compose up