You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-39Lines changed: 21 additions & 39 deletions
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,6 @@ Deploying web projects should be [simple, with high availability and security](h
9
9
10
10
## Table of Contents
11
11
-[Features](#features)
12
-
-[Why would I use this over Traefik?](#why-would-i-use-this-over-traefik)
13
12
-[Requirements](#requirements)
14
13
-[Quick Start with Samples](#quick-start-with-samples)
15
14
-[Provided Samples](#provided-samples)
@@ -50,59 +49,36 @@ Deploying web projects should be [simple, with high availability and security](h
50
49
51
50
## Features
52
51
53
-
-``Pure Docker`` (No Need for Binary Installation Files and Complex Configurations)
54
-
- On Linux, you only need to have ``docker, docker-compose`` and some helping libraries such as ``git, curl, bash, yq(v4.35.1)`` installed.
55
-
- So, this is available for both non-cloud and cloud environments. You only need one machine.
56
-
- With your ``.env, project, and its sole Dockerfile``, Docker-Blue-Green-Runner manages the remainder of the Continuous Deployment (CD) process with [wait-for-it](https://github.com/vishnubob/wait-for-it), [consul-template](https://github.com/hashicorp/consul-template) and [Nginx](https://github.com/nginx/nginx). Just run ``bash run.sh``.
57
-
- 'wait-for-it' can be a reliable tool to ensure your container is fully up and ready before proceeding with dependencies or further operations.
58
-
- Using 'consul-template' allows your application to dynamically switch to blue or green deployments. Implementing an Nginx Contingency Plan can provide an added layer of stability to handle potential issues gracefully.
- Focus on zero-downtime deployment on a single machine.
64
-
- While Kubernetes excels in multi-machine environments with the support of Layer 7 (L7) technologies (I would definitely use Kubernetes in that case), this approach is ideal for scenarios where only one or two machines are available.
65
-
- However, ``for deployments involving more machines, traditional Layer 4 (L4) load-balancer using servers could be utilized.``
66
-
67
-
## Why would I use this over Traefik?
68
-
69
-
-**Unpredictable Errors in Reverse Proxy**
70
-
- 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.
52
+
-**No Unpredictable Errors in Reverse Proxy and Deployment**
53
+
- If any error occurs in the app or router, deployment is halted to prevent any impact on the existing deployment
54
+
- For example, 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.
- 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.
74
-
- 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).
57
+
- 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.
75
58
76
59
-**From Scratch**
77
60
- 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.
78
61
- In contrast, Traefik requires the creation and gradual adjustment of various configuration files, which can introduce the types of errors mentioned above.
79
62
80
-
-**Speed**
81
-
- NGINX generally offers faster performance, though I acknowledge that Traefik's robust features can offset this advantage.
63
+
- Focus on zero-downtime deployment on a single machine.
64
+
- While Kubernetes excels in multi-machine environments with the support of Layer 7 (L7) technologies (I would definitely use Kubernetes in that case), this approach is ideal for scenarios where only one or two machines are available.
65
+
- However, ``for deployments involving more machines, traditional Layer 4 (L4) load-balancer using servers could be utilized.``
82
66
83
67
84
68
## Requirements
85
69
86
-
87
70
### OS
88
71
89
-
- If this module operates well on WSL2 in WIN, there should be no issues using it on an Ubuntu Linux server, especially considering the instability of WSL2.
90
-
- If you are using WSL2 in WIN10 (not WIN11), which has the CRLF issue, you should run `bash prevent-crlf.sh` twice, and then execute the required `.sh` file.
91
-
- The error message you might encounter is `$'\r': command not found`.
92
-
- When using WSL2, I recommend cloning the project into the WSL area (`\\wsl$\Ubuntu\home`) instead of `C:\`.
93
-
- Available on MacOS as long as GNU-based libraries are installed. See the 'Dependencies' section for more details.
94
-
-**Summary**: Linux is more stable than WSL2, and WSL2 is not recommended for production environments.
95
-
96
-
97
-
### Docker Considerations
98
-
99
-
-**No Container in Container**:
100
-
- Do not use Docker-Blue-Green-Runner inside containers, such as those provided by CircleCI or Dockerized Jenkins. These builders run within their own container environments, making it difficult for Docker-Blue-Green-Runner to utilize volumes.
101
-
- This issue is highlighted in the [CircleCI discussion on 'docker-in-docker-not-mounting-volumes'](https://discuss.circleci.com/t/docker-in-docker-not-mounting-volumes/14037/3).
72
+
- Linux based OS such as Ubuntu, CentOS, WIN WSL and MacOS
73
+
- If you are using WSL2 in WIN10 (not WIN11), which has the CRLF issue, you should run `bash prevent-crlf.sh` twice, and then execute the required `.sh` file.
74
+
- The error message you might encounter is `$'\r': command not found`.
75
+
- When using WSL2, I recommend cloning the project into the WSL area (`\\wsl$\Ubuntu\home`) instead of `C:\`.
76
+
- Available on MacOS as long as GNU-based libraries are installed. See the 'Dependencies' section for more details.
102
77
78
+
103
79
### Application Requirements
104
80
105
-
- The image or Dockerfile in your application must include the `bash` and `curl` commands, as demonstrated in the `./samples/spring-sample-h-auth` folder as an example.
81
+
- The image or Dockerfile in your application should include the `bash` and `curl` commands, as demonstrated in the `./samples/spring-sample-h-auth` folder as an example.
106
82
- Do **not** build or run 'local' and 'real' environments simultaneously, as both share the same image and container names.
107
83
-```shell
108
84
# In your .env,
@@ -111,10 +87,16 @@ Deploying web projects should be [simple, with high availability and security](h
111
87
112
88
### Permissions and File Structure
113
89
114
-
- You can run your project with `bash run.sh`, but if you encounter any permission issues, use`sudo bash run.sh`.
90
+
- You can run your project with `bash run.sh`, but if you encounter any permission issues, run`sudo bash run.sh`.
115
91
- Although the sample folders are included in this project, it is recommended that you place your own projects in external directories and always use absolute paths.
116
92
117
93
94
+
### Docker Considerations
95
+
96
+
- **No Container in Container**:
97
+
- Do not use Docker-Blue-Green-Runner inside containers, such as those provided by CircleCI or Dockerized Jenkins. These builders run within their own container environments, making it difficult for Docker-Blue-Green-Runner to utilize volumes.
98
+
- This issue is highlighted in the [CircleCI discussion on 'docker-in-docker-not-mounting-volumes'](https://discuss.circleci.com/t/docker-in-docker-not-mounting-volumes/14037/3).
0 commit comments