{"id":31062076,"url":"https://github.com/sougata-github/devops-crash-course","last_synced_at":"2026-02-14T02:02:04.187Z","repository":{"id":314858495,"uuid":"1056992278","full_name":"sougata-github/devops-crash-course","owner":"sougata-github","description":"Devops crash course JS Mastery","archived":false,"fork":false,"pushed_at":"2025-11-05T02:51:23.000Z","size":102,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-05T04:08:38.550Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sougata-github.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-15T06:14:42.000Z","updated_at":"2025-11-05T02:51:26.000Z","dependencies_parsed_at":"2025-09-15T09:09:22.257Z","dependency_job_id":"feafc5f4-1749-4264-b642-623abba094a2","html_url":"https://github.com/sougata-github/devops-crash-course","commit_stats":null,"previous_names":["sougata-github/devops-crash-course"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sougata-github/devops-crash-course","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sougata-github%2Fdevops-crash-course","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sougata-github%2Fdevops-crash-course/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sougata-github%2Fdevops-crash-course/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sougata-github%2Fdevops-crash-course/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sougata-github","download_url":"https://codeload.github.com/sougata-github/devops-crash-course/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sougata-github%2Fdevops-crash-course/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29431593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T22:20:51.549Z","status":"online","status_checked_at":"2026-02-14T02:00:07.626Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-15T11:48:01.338Z","updated_at":"2026-02-14T02:02:04.181Z","avatar_url":"https://github.com/sougata-github.png","language":"CSS","readme":"## DevOps is the process of how an idea becomes software in user's hands and gets better with feedback.\n\nStages in Dev + Ops:\n\nPlan:\n\n- What to Build\n- When to Ship\n- Who owns what\n- Measure success\n- Page Speed\n- User Growth\n- Revenue\n\nUse tools like Jira, Linear, Github projects, Notion, etc.\n\nCode:\n\n- Clean, Modular and Testable code\n- Use Git for version control\n\nBuild:\n\n- Preparing code for production\n- Compiling or Transpiling source code\n- Bundled or packaged (like in Docker)\n- Check for linting or security mistakes\n\nTest:\n\n- To catch bugs early\n- Unit, Integration and End to end tests\n\nExample: Payment system: Unit tests verify math for totals, Integration tests ensure checkout works with DB and End to end tests simulate customer completing a purchase\n\nBy the time code passes the above stages, team can be confident that app won't break in production. All of these run in automation pipelines. When all the tests pass, the build is marked ready for release.\n\nRelease:\n\n- Versioning\n- Tagging Artifacts\n- Pushing them into a release repo (Docker Hub, Nexus)\n\nThis ensures the exact same build that was tested will be deployed later on.\n\nDeployment:\n\n- In Devops, deployments are automated and repeatable\n- Pipelines handle the process, tools like Kubernetes orchestrate deployments at scale\n\nOperate:\n\n- To ensure system continues to run reliably under real world conditions\n- Monitoring Server health\n- Applying security patches\n- Managing infrastructure configs\n- Scaling resources when traffic spikes\n\nMonitoring:\n\n- Gathering data about system's performance\n- Uptime, error rates and business metrics (Sentry)\n\nAnd the cycle continues...\n\n## CI/CD\n\nCoding -\u003e Building -\u003e Testing -\u003e Deployment. It's an automated conveyer belt for software.\n\nCI -\u003e Continuous Integration. Everytime a developer pushes code, tests run automatically and if something breaks, the pipeline stops and we fix it before moving forward.\n\nCD -\u003e Continuous Deployment. Once all the tests are passed, app is automatically deployed to staging or production.\n\nThese pipelines are written using tools like github actions, jenkins, etc.\n\nContainers eliminate versioning conflicts by packaging applications along with all their dependencies, ensuring consistency across environments. Most popular tool is Docker.\n\nContainer orchestration is the process of managing and running containers at scale. Go to tool here is Kubernetes.\n\nInfrastructure as Code (IaC) is the practice of provisioning and managing infrastructure through code instead of manual processes, with Terraform being one of the most popular tools.\n\nScripting to automate processes.\n\nA pipeline is a set of automated steps that takes your code from the moment you push it all the way to production.\n\nTools: Jenkins, GitLab CI/CD, Circle CI, Travis CI, Azure DevOps.\nMost devs prefer Github Actions.\n\nGithub Actions pipeline is a workflow. Workflows live inside your repo (.github/workflows) Each Workflow is a `.yaml` file (triggers, events and jobs)\n\nImportant YAML keywords:\n\n- `name`: Workflow/job title\n- `on`: Defines triggers (push, PR, schedule)\n- `jobs`: Define jobs, their OS, and steps\n- `steps`: Sequential commands or actions\n- `run`: Shell commands to execute\n- `uses`: Use prebuilt actions\n- `with`: Set environment variables\n- `needs`: Make one job depend on another\n\n```yaml\nname: CI Pipeline\n\non:\n  push:\n    branches: [main]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n\n    steps:\n      - name: Checkout code\n        uses: actions/checkout@v5\n      - name: Set up Node.js\n        uses: actions/setup-node@v3\n        with:\n          node-version: 20\n      - name: Install dependecies\n        run: npm install\n      - name: Run tests\n        run: npm test\n```\n\n| **Part**                                                          | **Explanation**                                                                 |\n| ----------------------------------------------------------------- | ------------------------------------------------------------------------------- |\n| `name: CI Pipeline`                                               | The name of the workflow, visible in the GitHub Actions tab.                    |\n| `on:` → `push:` → `branches: [main]`                              | Defines the trigger. Runs only when code is pushed to the `main` branch.        |\n| `jobs:` → `build:`                                                | A job is a set of steps. Here we define a single job named `build`.             |\n| `runs-on: ubuntu-latest`                                          | The virtual machine (runner) environment. Uses the latest Ubuntu Linux image.   |\n| `steps:`                                                          | Sequence of tasks the job will run.                                             |\n| **Step 1:** `uses: actions/checkout@v5`                           | Checks out your repository’s code into the runner so other steps can access it. |\n| **Step 2:** `uses: actions/setup-node@v3` with `node-version: 20` | Installs and configures Node.js (version 20) on the runner.                     |\n| **Step 3:** `run: npm install`                                    | Installs project dependencies from `package.json`.                              |\n| **Step 4:** `run: npm test`                                       | Executes your project’s test suite.                                             |\n\n## Version Control (Git)\n\nGit is a distributed version control system. The version control part helps you track and manage code changes over time. Distributed means every developer's computer has a complete copy of the codebase, including the entire history of changes and information about who changed what and when. It eases our worflow.\n\nA repo is where git tracks everything in your project.\n\nGithub is a cloud platform that allows you to store your repositories online and collaborate with others.\n\n## Docker\n\nDocker makes sure our code runs conistently across all environments. It is a platform that enables development, packaging and execution of applications in a unified environment.\n\nBy clearly specifying our app's requirements such as Node.js and necessary packages, Docker generates a self contained box that includes it's own operating system and all the components essential for running our app. This box acts like a separate computer virtually providing the o.s, runtimes and everything required for our app to run smoothly.\n\nAdvantages:\n\n- Consistency across environments\n- Isolation (boundary b/w app and it's dependencies)\n- Portability (move app across different stages, dev to test to prod)\n- Version Control\n- Scalability (Docker makes copies of our app when needed)\n- Devops integration\n\nDocker containers are lightweight and share the host system resources making them more efficient than traditional virtual machines leading to fast start times and reduced resource usage.\n\n### How does Docker work?\n\nTwo main concepts:\n\n- Images\n- Containers\n\nEntire workflow revloves around the two.\n\nA **Docker Image** is a lightweight, standalone executable package that includes everything to run a piece of software (including code, runtime like Node.js, libraries, system tools and even the operating system)\n\nThese images need to run somewhere. This is where **Docker Containers** come in. A Docker container is a runnable instance of a Docker image. It represents the execution environment for a specific application. A container takes everything specified in the image and follows it's intructions by executing necessary commands like downloading packages and setting things up to run our app.\n\nWe can run multiple containers from a single image. Create one image and get as many instances you want in the form of containers.\n\nA **Docker Volume** is a persistent data storage mechanism that allows data to be shared between a docker container and the host machine or even multiple containers.\n\n**Docker Network** is a communication channel that enables different docker containers to talk to each other or with external world. It creates connectivity allowing containers to share information and services while maintaining isolation.\n\n### Docker Workflow\n\nDocker Client: User interface (CLI or GUI) for interacting with Docker. Tool we use to give Docker commands (build, run and manage images or containers)\n\nDocker Host (Docker Daemon): Background process responsible for managing containers on host systems. It listens for Docker client commands, creates and manages containers, builds images and handles other Docker related tasks.\n\nDocker Registry (Docker Hub): Centralised repo of Docker images. It hosts both public and private registries or packages. Docker images are stored in these registries and when we run a container, Docker may pull the image from the registry if it's unavailable locally.\n\nDocker is to DockerHub is what Git is to GitHub\n\n### Creating a Docker Image\n\nA docker image is a special `docker` file. It is a set of instructions telling docker how to build an image for your app.\n\nSome commands/keywords:\n\n- `FROM`: Specifies base image to use for new image\n- `WORKDIR`: Sets the working directory for instructions\n- `COPY`: Files or directories from the build context to image\n- `RUN`: Executes command in shell during image build\n- `EXPOSE`: Tells containers to listen to specific network ports at run time\n- `ENV`: Sets environment variables during build process\n- `ARG`: Defines build time variables\n- `VOLUME`: Specifies location inside container for connecting external storage\n- `CMD`: Default command to execute when container starts (can be overridden)\n- `ENTRYPOINT`: Specifies default executable to be run when container starts (cannot be overridden)\n\nPulling an image from Docker Registry: `docker pull ubuntu`\n\nRunning the image: `docker run -it \u003cimage-name\u003e`\n\nThe above command generates a container based on the pulled image.\n\nCreating a Docker Image:\n\n- Create a `Dockerfile` at the root.\n- Select base image to run the app.\n  - Since we want to run a JS/TS file we can select a Node runtime from Docker Hub.\n- Set the working directory to /app. This is the directory where commands will be run.\n- Copy everything from current directory to Docker image\n- Specify the command to run the app\n- Build the image: go to directory where the Dockerfile is and run `docker build -t \u003cimage-name\u003e \u003cpath\u003e`\n- Run `docker images` to check all images\n- Containerise your app: `docker run \u003cimage-name\u003e`\n- If you want to open your app in shell mode: `docker run -it \u003cimage-name\u003e sh`\n- `.` -\u003e current working directory\n\nPORT MAPPING - Allows us to map ports between Docker container and host machine\n\n`docker run -p \u003cport\u003e:\u003cport\u003e \u003cimage-name\u003e`\n\nMount the current working directory into the app directory inside container. Local code gets linked to container. Any changes made will be immediately reflected: `docker run -p \u003cport\u003e:\u003cport\u003e -e CHOKIDAR_USEPOLLING=true -v \"$(pwd):/app\" -v /app/node_modules \u003cimage-name\u003e`\n\nv is the volume here\n\n-e sets the environment variable at runtime. CHOKIDAR_USEPOLLING=true. Essentially telling Vite inside the container to use polling mode to pick up changes.\n\n```bash\n-v \"$(pwd):/app\"\n```\n\nthe above mount overwrites /app entirely — including /app/node_modules.\nSo those Linux-compatible deps get hidden created during build\n\nSolution is to add a second mount\n\n```bash\n-v /app/node_modules\n```\n\n/app comes from your host machine (code, package.json, etc.)\n\nand when adding new deps reinstall inside the running container or rebuild the entire image\n\n```bash\ndocker -exec -it \u003ccontainer_name\u003e pnpm install\n```\n\n- all containers: `docker ps -a`\n- running containers: `docker ps`\n- remove a specific container: `docker rm \u003ccontainer-id\u003e`\n- get rid of stopped containers: `docker container prune`\n- stopping a running container: `docker stop \u003ccontainer-id\u003e`\n\n### Publishing Docker Image\n\n- cd into working directory\n- docker login\n- docker tag `\u003cimage-name\u003e \u003cusername\u003e/\u003cimage-name\u003e`\n- docker push `\u003cusername\u003e/\u003cimage-name\u003e`\n\n### Automating the containerising process\n\nWe can improve the workflow by using `Docker Compose` and run everything our application needs to run using a single command.\n\nDocker Compose is a tool that helps us to define and manage multi-container docker applications. It uses a yaml file to configure the services, networks and volumes for your app.\n\nWe can also use `docker init` to generate the docker compose yaml file based on our preferences.\n\nTo run the compose.yaml use `docker compose up` or `docker compose up -d` to run in detached mode.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsougata-github%2Fdevops-crash-course","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsougata-github%2Fdevops-crash-course","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsougata-github%2Fdevops-crash-course/lists"}