Deploy & run Docker Compose project for WordPress instance (3 separate containers running WordPress PHP7 FPM, Nginx and MariaDB) with Let's Encrypt HTTPS encryption
Branch: master
Clone or download
Latest commit 83b074a Mar 19, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
tasks added new mechanism for waiting until site is reachable Mar 9, 2018
templates fix for wordpress HTTP error upload error Mar 10, 2018
.gitignore added all core components for wordpress-docker-deploy role May 19, 2017
LICENSE Initial commit May 19, 2017
ansible.cfg added all core components for wordpress-docker-deploy role May 19, 2017

Ansible Role: Containerized WordPress

This Ansible playbook will Deploy & run Docker Compose project for WordPress instance. It will also configure Let's Encrypt certificates for specified domain. It consists of 3 separate containers running:

  • WordPress (PHP7 FPM)
  • Nginx (enabled with Let's Encrpt HTTPS encryption)
  • MariaDB

This role was created as part of containerized-wordpress-project


For this role to work, it is required to have have Docker and Docker Compose installed and setup. If you haven't done this already (manually), then you're required to install following role: AdnanHodzic.docker-compose.

Role Variables

This role comes with following variables defined in defaults/main.yml:

system_user: ubuntu
compose_project_dir: /home/{{ system_user }}/compose-wordpress
stage: false
wp_version: 4.9.4
php_fmp_version: php7.1-fpm
wp_db_name: wordpress
wp_db_tb_pre: wp_
wp_db_host: mysql
wp_db_psw: change-M3

If role is run without changing these, WordPress instance with Nginx virtual host as well as Database settings will be setup with these values.

stage is an important value and its detailed explanation can be found on: Let's Encrypt certificates (HTTPS encryption)

Blog post discussion:


ToDo: Determine if "AdnanHodzic.docker-compose-setup" role should be set as role dependency. If yes, update this section of ReadMe + meta code.

Example Playbook

- hosts: servers
  remote_user: "{{ system_user }}"
    - { role: AdnanHodzic.containerized-wordpress }}