WordPress with nginx, php7-fpm, MySQL and PhpMyAdmin
Built using Oficial images:
- Nginx.
- PHP altered to install
docker-php-ext-install pdo pdo_mysql mysqli
(check/php
folder). - MySQL.
- PHPMyAdmin.
Environment variables
- Rename
.env-demo
to.env
and set environment variables.
# APP Name
APP=appname
# Set persistent directories for
# the database and WordPress.
PERSISTENT_APP=./wordpress
PERSISTENT_DB=./db/mysql
# mysql
MYSQL_HOST=mysql
MYSQL_ROOT_PASSWORD=pwd
MYSQL_DATABASE=db
MYSQL_USER=user
MYSQL_PASSWORD=secret
Get WordPress
Download WordPress into the main folder. Can change name and update PERSISTENT_APP
value.
Run Docker
- Run
docker-compose up
(needs Docker Compose installed).
Once running
- Go to your http://0.0.0.0/ and start configurate WordPress.
- PhpMyAdmin at http://0.0.0.0:8080/.
Requirements
- Docker Engine.
- Docker Compose.
- Docker Machine (Mac and Windows only).
Credit
Tried to deal with persistent as osteel's blog friends tells to test benefits (looking forward to hear any opinions related).