Docker Wordpress
Using Wordpress with SSL enabled integrated with NGINX proxy and autorenew LetsEncrypt certificates
This docker-compose should be used with [NGINX Proxy Automation](https://github.com/evertramos/nginx-proxy-automation.
Usage
After everything is settle, and you have your three containers running (proxy, generator and letsencrypt) you do the following:
- Clone this repository:
git clone https://github.com/evertramos/docker-wordpress.git
- Update the service name in your docker-compose.yml file VERY IMPORTANT
You must use any name, but make sure it is a unique service name in your environment, otherwise it will conflict with other services.
- Configure your .env file:
Copy .env.sample to .env and update with your data
The proxy network must match the network name you have set in the proxy settings.
- Start your project
docker-compose up -d
Be patient - when you first run this repo, the database might take sometime to launch and the process of getting a new certificate for your domain might take some time.
Make sure the wordpress data files has user and group set to www-data, so you could update, install, delete files from your admin panel.
NGINX Proxy Automation
Further Options
wp-cli (https://wp-cli.org/)
For whoever uses wp-cli here is how to implement it on this repo.
Test to see if it´s working
./wp-cli-test.sh
If you would, add the alias “wp” to your .bash_aliases
:
alias wp="docker-compose run --rm wpcli"
Next time you need to run a wp-cli command just go to where you have your docker-compose file and run a wp
command.
Known Issues
Azure
Running docker on Azure servers you must mount your database in your disks partitions (example: /mnt/data/
) so your db container can work. This is a some kind of issue regarding Hyper-V sharing drivers… not really sure why.
Versions
The versioning of this project matches the Server Automation and NGINX proxy automation.
Table of compatibility:
docker-wordpress | nginx-proxy-automation | server-automation |
---|---|---|
v0.5 | v0.5 | v0.5 |