====== Local Deployments ====== ===== Docker Compose ===== Docker Compose is the easiest way to do local deployments for testing and development. ==== Prerequisites ==== === Installing Docker Compose === Run the following command to install docker compose: brew install docker-compose ==== Deployment Steps ==== === Manual Deployment === Makes sure you are in the build directory by running the following:cd build You can use the ''%%docker-compose up%%'' command to manually spin up containers: docker-compose up -d --build Here are some examples: docker-compose up -d --build 401k-calculator-api # spins up the 401k calculator api container docker-compose up -d --build webapp # spins up the webapp container You can deploy all of the containers by running the following command: docker-compose up --build -d You can bring down all containers by running the following command: docker-compose down === Makefile deployment === You can find all of the makefile targets [[https://github.com/zachary-walters/cultivate-finance/blob/main/build/Makefile|here]]. Makes sure you are in the build directory by running the following:cd build You can deploy (and redeploy) all of the containers by running: make up_build ===== Minikube ===== Minikube is how we can locally deploy our kubernetes cluster. ==== Prerequisites ==== === Installing Minikube === Run the following command to install minikube: brew install minikube === Updating your /etc/hosts === We need to update our /etc/hosts file to properly route requests to our minikube cluster. We can do that by adding the following line to /etc/hosts file 127.0.0.1 cultivatefinance.org You can do that with a single command: sudo echo '127.0.0.1 cultivatefinance.org' >> /etc/hosts ==== Deployment Steps ==== - Start Minikube: minikube start - Enable ingress to our minikube cluster: minikube addons enable ingress - Deploy our services: cd build make k_deploy_ingress # deploys our ingress make k_deploy_webapp # deploys the webapp service make k_deploy_nats # deploys our NATS message queue make k_deploy_api # deploys our API Gateway make k_deploy_401k # deploys our 401k API - Create minikube tunnel (only for macOS): sudo minikube tunnel