From 5268625669817057a6f1b5ec6c86a51225e20759 Mon Sep 17 00:00:00 2001 From: Andrew-Kang-G Date: Wed, 30 Oct 2024 23:05:28 +0900 Subject: [PATCH] doc : additional README --- README.md | 5 +++-- .../Deploy-React-Project-with-DBGR.md | 13 ++++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) rename Deploy-React-Project-with-DBGR.md => documents/Deploy-React-Project-with-DBGR.md (94%) diff --git a/README.md b/README.md index 9b6418d..5f489be 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,8 @@ Deploying web projects should be [simple, with high availability and security](h - On Linux, you only need to have ``docker, docker-compose`` and some helping libraries such as ``git, curl, bash, yq(v4.35.1)`` installed. - So, this is available for both non-cloud and cloud environments. You only need one machine. - 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``. - + - 'wait-for-it' can be a reliable tool to ensure your container is fully up and ready before proceeding with dependencies or further operations. + - 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. ![consists-of.png](/documents/images/consists-of.png ) @@ -145,7 +146,7 @@ Deploying web projects should be [simple, with high availability and security](h | React | X | O | ### How to Start with a React Guide (Real) -[Link : Deploy your static React project](Deploy-React-Project-with-DBGR.md) +[Link : Deploy your static React project](documents/Deploy-React-Project-with-DBGR.md) ### How to Start with a Node Sample (Local) - Check the port number 13000 available before getting this started. diff --git a/Deploy-React-Project-with-DBGR.md b/documents/Deploy-React-Project-with-DBGR.md similarity index 94% rename from Deploy-React-Project-with-DBGR.md rename to documents/Deploy-React-Project-with-DBGR.md index f03a0fc..3c8a967 100644 --- a/Deploy-React-Project-with-DBGR.md +++ b/documents/Deploy-React-Project-with-DBGR.md @@ -2,7 +2,7 @@ ## The Goal - External -> Docker-Blue-Green-Runner (443 port) -> Your App (8360 port) -- For a perfectly static React app, your application should include NGINX, which requires more setup compared to something like Spring Boot, which can be run directly from the command line, or use Next.js. +- For a perfectly static React app, your application should include NGINX, which requires more setup compared to something like Spring Boot, which can be run directly from the command line, or you wouldn't love that, use Next.js. ## Locate projects - Clone the project https://github.com/patternhelloworld/docker-blue-green-runner at to ``/var/projects/docker-blue-green-runner`` (the path is not important; adjust as per your setup). @@ -10,6 +10,12 @@ ## Runner-side work ### Create a .env file in the Runner's Root Directory +#### Points +- ``443`` indicated below +- ``DOCKER_BUILD_ARGS`` for your Dockerfile +- ``DOCKER_COMPOSE_REAL_SELECTIVE_VOLUMES`` for your Volumes. +- ``REDIRECT_HTTPS_TO_HTTP`` +- .env file - ```dotenv HOST_IP=host.docker.internal APP_ENV=real @@ -110,13 +116,14 @@ ### Dockerfile - At ``/var/projects/your-app``, write the following. - The ARG below PROJECT_ROOT_IN_CONTAINER is passed from the above during the building process. + ```Dockerfile FROM node:18.20.4-slim AS build ARG PROJECT_ROOT_IN_CONTAINER RUN mkdir -p $PROJECT_ROOT_IN_CONTAINER -COPY . $PROJECT_ROOT_IN_CONTAINER +COPY .. $PROJECT_ROOT_IN_CONTAINER WORKDIR $PROJECT_ROOT_IN_CONTAINER RUN export NODE_OPTIONS="--max-old-space-size=2048" RUN whereis npm && alias npm='node --max_old_space_size=2048 /usr/local/bin/npm' @@ -137,7 +144,7 @@ COPY --chown=nginx --from=build $PROJECT_ROOT_IN_CONTAINER/dist/ $PROJECT_ROOT_I USER root WORKDIR $PROJECT_ROOT_IN_CONTAINER -COPY ./.docker/ssl /etc/nginx/ssl +COPY ../.docker/ssl /etc/nginx/ssl COPY ./.docker/entrypoint.sh /entrypoint.sh RUN chmod a+x /entrypoint.sh