Built using Oficial images:
- Nginx.
- PHP altered to install
docker-php-ext-install pdo pdo_mysql mysqli sendmail
(check/php
folder). - MySQL.
- PHPMyAdmin.
- Run
git clone https://github.com/abdo-farag/docker-compose-wordpress.git
- Run
cd docker-compose-wordpress
- Edit
.env
and set environment variables.
# APP Name
APP=appname
# Set persistent directories for
# the database and WordPress.
PERSISTENT_APP=/opt/wordpress
PERSISTENT_DB=/opt/mysql
# mysql
MYSQL_HOST=mysql
MYSQL_ROOT_PASSWORD=pwd
MYSQL_DATABASE=db
MYSQL_USER=user
MYSQL_PASSWORD=secret
- Run
mkdir -p /opt/logs/nginx
- Run
mkdir -p /opt/mysql
- Run
mkdir -p /opt/nginx/conf.d/
- Run
mkdir -p /opt/wordpress
- Run
cp nginx/conf.d/* /opt/nginx/conf.d/
Download WordPress into the main folder. Can change name and update PERSISTENT_APP
value.
- Run
docker run -it --rm -p 443:443 -p 80:80 --name letsencrypt -v "/etc/letsencrypt:/etc/letsencrypt" -v "/var/lib/letsencrypt:/var/lib/letsencrypt" quay.io/letsencrypt/letsencrypt:latest auth
- Run
docker-compose up
(needs Docker Compose installed).
- Go to your http://0.0.0.0/ and start configurate WordPress.
- PhpMyAdmin at http://0.0.0.0:8080/.
- Docker Engine.
- Docker Compose.
- Docker Machine (Mac and Windows only).