Skip to content

noob-master147/codebar-devops

Repository files navigation

codebar festival 2021 - Devops Demystified

Session by Divyansh Khandelwal


This repository contains the code used in the session with some useful links for the community members.

Steps to follow along


Step 1 -> Get the Code

Here is the git repo
Do drop a star, will make me happy 😊

Clone the Repository

git clone https://github.com/noob-master147/codebar-devops.git


Step 2 -> Install Docker and Docker Compose on your system

Skip this step if you already have installed docker and docker compose.

Docker | Mac | Windows | Ubuntu |

Docker Compose Guide

Confirm your installation by running sudo docker version

Step 3 -> Create account on Docker Hub


Step 4 -> Run the project locally

sudo docker-compose up --build -d

Check the services

sudo docker ps

docker ps

Port Service
http://localhost:3000 React-Frontend
localhost:27017 MongoDB



Step 5 -> Create an EC2 instance on AWS

Read The Docs

Step 6 -> Install Docker and DockerCompose on EC2 instance

Use the script available here

Drop a ⭐ on the gist or bookmark it.

  • sudo curl https://gist.githubusercontent.com/noob-master147/f96aef074bf28d1db7276e365b646ba5/raw/692550e5c5d053fff0b876fcfd66eac25c073f9d/script.sh >> script.sh

  • sudo bash script.sh

    • After this step you will have docker and docker-compose installed in your EC2 instance.

Step 7 -> Copy the Docker-Compose file on EC2 instance

  • sudo nano docker-compose.yml
    • paste the docker-compose file contents.
    • press ctrl+x y enter to save and exit.

Step 8 -> Pull the images and run

sudo docker-compose pull
sudo docker-compose up --build 

Step 9 -> Setup GitHub Actions for CI/CD pipelines

  • add repository secrets
    • HOST
    • PORT
    • USERNAME
    • KEY
    • DOCKER_USER
    • DOCKER_PASSWORD
  • Create Workflow YAML file
    • use this gist as template.
    • update the tags and the image names



Step 10 -> Push a commit and see the MAGIC !

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages