AdnanHodzic.containerized-wordpress
Ansible Role: Containerized WordPress
This Ansible playbook sets up and runs a Docker Compose project for a WordPress website. It also configures Let's Encrypt certificates for the given domain. The setup includes three containers:
- WordPress
- Nginx (with HTTPS encryption using Let's Encrypt)
- MySQL
This role is part of the containerized-wordpress-project.
Requirements
To use this role, you must have Docker and Docker Compose installed. If you haven't installed them manually, you need to install this role: AdnanHodzic.docker-compose.
Role Variables
The role has several variables defined in defaults/main.yml:
system_user: ubuntu
compose_project_dir: /home/{{ system_user }}/compose-wordpress
domain: foolcontrol.org
stage: staging
wp_version: 5.4.2
wp_db_user: admin
wp_db_psw: change-M3
db_root_psw: change-M3
wp_db_name: wordpress
wp_db_tb_pre: wp_
wp_db_host: mysql
If you run the role without changing these values, it will set up a WordPress instance with Nginx and database settings using the default values provided.
stage
is an important variable, and you can find more information about it here: Let's Encrypt certificates (HTTPS encryption)
Blog posts discussing this topic:
- Automated way to get Let’s Encrypt certificates for WordPress using Docker + Ansible
- Easily deploy & run containerized WordPress (PHP7 FPM, Nginx, MariaDB) using Ansible + Docker on AWS
Dependencies
To Do: Decide if the "AdnanHodzic.docker-compose-setup" role should be listed as a dependency for this role. If it should, update this section of the ReadMe and the meta code.
Example Playbook
- hosts: servers
remote_user: "{{ system_user }}"
roles:
- { role: AdnanHodzic.containerized-wordpress }
License
GPLv3
Donate
Since I work on this project in my free time, please consider supporting it with a donation of any amount!
PayPal
BitCoin
Deploy & run Docker Compose project for WordPress instance (3 separate containers running WordPress, Nginx and MySQL) with Let's Encrypt HTTPS encryption
ansible-galaxy install AdnanHodzic.containerized-wordpress