A simple docker-compose.yml for WordPress development.
This is not secure. Don't use it on a production environment
Install docker:
- Docker installation for Mac
- Docker installation for Windows
- Docker installation for Ubuntu
Install docker-compose: multi-platform documentation
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)
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
Find your WordPress website at http://localhost:8080.
Find your PHPMyAdmin at http://localhost:8181.
DB root password: secret
DB WordPress user: wordpress
DB WordPress password: wordpress
Connect to PHPMyAdmin:
- Server:
db
- User:
root
- Password:
secret
- db: Persistent volume to store MariaDB database.
- wp: Persistent volume to store WordPress files.
make perm
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 );
MariaDB has to restart to load the configuration file db-conf/enable-general-logs.cnf
.
make down up
Add the following line to wp-config.php
:
// Don't download through FTP
define('FS_METHOD', 'direct');
Stop the stack:
docker-compose down
Start the stack and see logs in terminal:
docker-compose up