DEV Community

Andrew Kang-G
Andrew Kang-G

Posted on

Zero-Downtime Blue-Green Deployment with a Simple 'git pull & bash run.sh' Command

https://github.com/patternhelloworld/docker-blue-green-runner

Why would I use this over Traefik?

  • Unpredictable Errors in Reverse Proxy
    Traefik offers powerful dynamic configuration and service discovery; however, certain errors, such as a failure to detect containers (due to issues like unrecognized certificates), can lead to frustrating 404 errors that are hard to trace through logs alone.
    https://stackoverflow.com/questions/76660749/traefik-404-page-not-found-when-use-https
    https://community.traefik.io/t/getting-bad-gateway-404-page-when-supposed-to-route-to-container-port-8443/20398
    Docker-Blue-Green-Runner manipulates NGINX configuration files directly to ensure container accessibility. It also tests configuration files by launching a test NGINX Docker instance, and if an NGINX config update via Consul-Template fails, Contingency Plan provided is activated to ensure connectivity to your containers.
    Additionally, the code is written in shell script, making it easier to trace the exact code section where an error occurs (as opposed to working with a binary).

  • From Scratch
    Docker-Blue-Green-Runner's run.sh script is designed to simplify deployment: "With your .env, project, and a single Dockerfile, simply run 'bash run.sh'." This script covers the entire process from Dockerfile build to server deployment from scratch.
    In contrast, Traefik requires the creation and gradual adjustment of various configuration files, which can introduce the types of errors mentioned above.

  • Speed
    NGINX generally offers faster performance, though I acknowledge that Traefik's robust features can offset this advantage.

Top comments (0)