⚙️

DevOps

Infrastructure, deployment, CI/CD, containers, and cloud configuration snippets.

18 snippets

Showing 18 of 18 snippets

bashintermediate

Docker Compose Multi-Service Setup

Docker Compose configuration for a Node.js app with PostgreSQL, Redis, and Nginx reverse proxy.

#docker#compose
bashadvanced

Kubernetes Deployment Configuration

Production-ready Kubernetes deployment with replicas, resource limits, health checks, and rolling updates.

#kubernetes#deployment
bashintermediate

Nginx Reverse Proxy Configuration

Nginx config to reverse-proxy requests to a backend with WebSocket support and security headers.

#nginx#reverse-proxy
bashintermediate

GitHub Actions CI/CD Pipeline

Complete GitHub Actions workflow with test, build, and deploy stages for a Node.js application.

#github-actions#ci-cd
javascriptintermediate

PM2 Process Manager Configuration

PM2 ecosystem file for managing Node.js processes with clustering, log rotation, and auto-restart.

#pm2#process-manager
bashintermediate

Systemd Service File for Node.js

Systemd unit file to run a Node.js app as a managed service with auto-restart and logging.

#systemd#linux
bashbeginner

Environment File Loader Script

Bash script that safely loads environment variables from a .env file with validation and defaults.

#env#bash
bashbeginner

Redis Docker Setup with Persistence

Docker Compose for Redis with persistence, password auth, memory limits, and a health check.

#redis#docker
bashbeginner

PostgreSQL Docker Setup with Init Script

Docker Compose for PostgreSQL with volume persistence, init scripts, and connection pooling.

#postgres#docker
bashadvanced

Nginx Load Balancer Configuration

Nginx upstream load balancer with weighted round-robin, health checks, and failover handling.

#nginx#load-balancer
bashintermediate

Nginx SSL Setup with Certbot

Bash script to install and configure SSL certificates with Certbot for Nginx with auto-renewal.

#ssl#certbot
typescriptintermediate

Health Check Endpoint with Dependency Checks

Express health check endpoint that verifies database, Redis, and disk connectivity with status reporting.

#health-check#monitoring
bashintermediate

Nginx Rate Limiting Configuration

Nginx rate limiting with multiple zones for API and login routes, burst handling, and custom error pages.

#nginx#rate-limiting
bashbeginner

Linux Cron Job Setup Examples

Common crontab entries for database backups, log cleanup, health checks, and certificate renewal.

#cron#linux
bashbeginner

Logrotate Configuration for Applications

Logrotate config for application logs with daily rotation, compression, and post-rotate hooks.

#logrotate#logging
bashintermediate

Dockerfile Multi-Stage Build

Multi-stage Dockerfile for Node.js with build, prune, and minimal production image layers.

#docker#dockerfile
bashadvanced

Terraform AWS EC2 Instance Setup

Terraform configuration to provision an EC2 instance with VPC, security group, and SSH key pair.

#terraform#aws
bashintermediate

GitHub Actions Docker Build and Push

GitHub Actions workflow to build a Docker image and push it to GitHub Container Registry on release.

#github-actions#docker