Giter VIP home page Giter VIP logo

adnanhodzic / ansible-role-containerized-wordpress Goto Github PK

View Code? Open in Web Editor NEW
19.0 3.0 30.0 61 KB

Deploy & run Docker Compose project for WordPress instance with Let's Encrypt HTTPS encryption

Home Page: https://galaxy.ansible.com/AdnanHodzic/containerized-wordpress

License: GNU General Public License v3.0

ansible docker nginx php7-fpm docker-compose docker-compose-template letsencrypt letsencrypt-certificates letsencrypt-utils wordpress ansible-role mariadb-server debian ubuntu mysql

ansible-role-containerized-wordpress's Introduction

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
  • Nginx (enabled with Let's Encrypt HTTPS encryption)
  • MySQL

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

Requirements

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
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 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:

Dependencies

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 }}"
  roles:
    - { role: AdnanHodzic.containerized-wordpress }}  

License

GPLv3

Donate

Since I'm working on this project in free time, please consider supporting this project by making a donation of any amount!

PayPal

paypal

BitCoin

bc1qlncmgdjyqy8pe4gad4k2s6xtyr8f2r3ehrnl87

bitcoin

ansible-role-containerized-wordpress's People

Contributors

adnanhodzic avatar imartzen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ansible-role-containerized-wordpress's Issues

Behind Traefik : Too many redirect

Hello,
I'm trying to do my best but it doesn't work : Too many redirect
I'm behind traefik and that is the docker-compose template generated :
Do you see something wrong?

version: '2.1'

services:
  https-portal:
    image: steveltn/https-portal:1
    container_name: https
    volumes:
      - ./logs/nginx:/var/log/nginx
    ports:
      - '801:80'
      - '802:443'
    environment:
      CLIENT_MAX_BODY_SIZE: '100M'
      GZIP: 'on'
      DOMAINS: 'lf.jpj.ovh -> http://wordpress:80'
      STAGE: 'local'
    restart: unless-stopped
    networks:
      - web
      - lf
    labels:
      traefik.enable: "true"
      traefik.http.routers.lf.rule: "Host(`lf.jpj.ovh`)"
      traefik.http.routers.lf.entrypoints: "websecure"

  wordpress:
    depends_on:
      db:
        condition: service_healthy
    image: wordpress:5.4.2-apache
    container_name: wp
    volumes:
      - ./wordpress:/var/www/html
      - ./wordpress/uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
    environment:
      WORDPRESS_DB_USER: 'admin'
      WORDPRESS_DB_NAME: 'lf'
      WORDPRESS_DB_PASSWORD: 'admin'
      WORDPRESS_DB_HOST: 'db'
      MYSQL_PORT_3306_TCP: '3306'
    restart: unless-stopped
    networks:
      - lf
   
  db:
    image: mysql:5.7
    container_name: db
    volumes:
      - ./wp-db-data:/var/lib/mysql
    healthcheck:
      test: "/usr/bin/mysql --user=root --password='admin' --execute \"SHOW DATABASES;\""
      interval: 2s
      timeout: 20s
      retries: 10
    environment:
      MYSQL_ROOT_PASSWORD: 'admin'
      MYSQL_DATABASE: 'lf'
      MYSQL_USER: 'admin'
      MYSQL_PASSWORD: 'admin'
    restart: unless-stopped
    networks:
      - lf

networks:
  web:
    external:
      name: web
  lf:  

I have a wildcard on jpj.ovh
And I want to test Wordpress as subdomain like lf.jpj.ovh
I don't know If I have to use the same networks.
Any idea ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.