Learn about Centmin Mod LEMP Stack today
Register Now

Docker Discuss Docker ideas for Centmin Mod LEMP stack

Discussion in 'Centmin Mod Docker Development' started by eva2000, Feb 21, 2015.

  1. eva2000

    eva2000 Administrator Staff Member

    53,461
    12,128
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,668
    Local Time:
    12:10 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    I am still a noob to Docker, so will need to rely on Docker gurus and experts to lead the way :) I posted some useful Docker info related links in sticky at Centmin Mod Docker Development forums | Centmin Mod Community so other folks new to Docker can read up and understand what Docker containers are etc.

    For Docker experts, how do you see Centmin Mod LEMP stack develop on Docker containers ? Each Centmin Mod main service having it's own Docker container for Nginx, PHP-FPM, MariaDB MySQL, Memcached server ?

    How would you go about doing this ? Any example Docker images or Docker files you can share ? for CentOS 6 and/or CentOS 7 ?

    If you're on Docker Hub, what's your profile url ? Mines hub.docker.com/u/centminmod/ :)

    If you're on Quay.io ? Mines quay.io/repository/?namespace=centminmod


    Looking forward to seeing what we can do with Centmin Mod LEMP stack and Docker :D
     
    Last edited: Feb 23, 2015
  2. eva2000

    eva2000 Administrator Staff Member

    53,461
    12,128
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,668
    Local Time:
    12:10 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    @Guilherme Jaccoud touched on the fact I should use the MariaDB official Docker images, so thought start discussion on that first :)

    One of the reasons, I tried making my own CentOS 6.6 + MariaDB 10 Docker image is I also wanted to set it up with my custom default MariaDB 10 mysql settings like I do with Centmin Mod LEMP stack as well as utilise other tools within the CentOS 6.6 container like my mysqlmymonlite.sh stats and info gather script. Which I would add to /root/tools custom directory to allow running to gather MySQL server stats like ones shown on the site at mysqlmymon.com. With the official MariaDB Docker images, is it possible to do that ?
     
  3. eva2000

    eva2000 Administrator Staff Member

    53,461
    12,128
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,668
    Local Time:
    12:10 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Besides Memcached and MariaDB Docker container images for Centmin Mod LEMP stack, just had an idea after watching some of the Docker videos I compiled a list of. One idea is having an easy catch all Nginx maintenance page when Nginx is down.

    Basically, you could have a very basic Nginx Docker container running on a Centmin Mod LEMP stack server say on local host to container mapped ports 8080:80 and tell the Nginx Docker container to map to host mount via -v /usr/local/nginx/html or where ever you want the static html maintenance page message to be located. Then set up an Nginx upstream load balanced entry with local host port 80 (live Centmin Mod built Nginx as primary) and setup the Nginx Docker container as backup only on local host port 8080.

    Code:
    upstream ngxbackend {
        server web1.example.com;
        server web1.example.com:8080   backup;
    }
    
    server {
        location / {
            proxy_pass http://backend;
        }
    }
    Then if Centmin Mod's Nginx server on port 80 goes down unexpectedly or during maintenance downtimes on Centmin Mod Nginx copy, it will trigger the Nginx Docker's version of Nginx server listening on local host port 8080 and serve up a static maintenance or site down message. :) It wouldn't matter how Nginx is configured in Nginx Docker image version as long as you are mapping to local directory where the static maintenance page is.

    Of course you'd then have to deal with configuring all your Nginx vhosts for Nginx proxying and that can get a bit complicated with Nginx pagespeed module added into the mix.

    edit: okay that sounded better in my head but obviously if primary Nginx is down, it won't be able to load balance to the backup specified backend LOL :facepalm: It would be only useful for user initiated maintenance like tasks when you bring down primary Centmin Mod's Nginx server backend unless you setup Haproxy load balancer, which can be apparently done via Haproxy Docker image too !
     
    Last edited: Feb 23, 2015
  4. eva2000

    eva2000 Administrator Staff Member

    53,461
    12,128
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,668
    Local Time:
    12:10 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    For 2016, definitely need to revisit Docker images and see what can be done with Centmin Mod LEMP stack environments :D