Skip to content

mahmoud755/lemmy-devops

Repository files navigation

🐾 Lemmy DevOps Portfolio

Production-grade deployment of a federated Reddit alternative built to demonstrate real-world DevOps practices.

Docker Nginx PostgreSQL GitHub Actions


📌 Overview

This project deploys Lemmy — an open-source, federated social platform — using a fully containerized, production-ready stack. Every component is wired together with health checks, resource limits, and a reverse proxy, mirroring how real-world services are run in production.


🏗️ Architecture

                        ┌─────────────────────────────┐
                        │         Docker Network       │
                        │                              │
          HTTP :80      │   ┌──────────────────────┐   │
User ─────────────────► │   │    Nginx (Proxy)      │   │
                        │   └───────────┬──────────┘   │
                        │               │               │
                        │     ┌─────────┴─────────┐    │
                        │     ▼                   ▼    │
                        │ ┌──────────┐  ┌─────────────┐│
                        │ │ lemmy-ui │  │    lemmy    ││
                        │ │  :1234   │  │    :8536    ││
                        │ └──────────┘  └──────┬──────┘│
                        │                      │        │
                        │           ┌──────────┴──────┐ │
                        │           ▼                 ▼ │
                        │      ┌─────────┐  ┌────────┐  │
                        │      │postgres │  │pictrs  │  │
                        │      │  :5432  │  │  :8080 │  │
                        │      └─────────┘  └────────┘  │
                        └─────────────────────────────┘

🛠️ Tech Stack

Layer Technology Purpose
Containerization Docker + Compose Service orchestration
Reverse Proxy Nginx Alpine Routing + load balancing
Backend Lemmy (Rust) API + federation
Frontend Lemmy-UI (Node) Web interface
Database PostgreSQL 16 Persistent storage
Media pictrs Image processing

🚀 Quick Start

Prerequisites

  • Docker >= 24.0
  • Docker Compose >= 2.0

Run Locally

# 1. Clone
git clone https://github.com/YOUR_USERNAME/lemmy-devops.git
cd lemmy-devops

# 2. Set permissions
mkdir -p volumes/pictrs volumes/postgres
sudo chown -R 991:991 volumes/pictrs

# 3. Start
docker compose up -d

# 4. Verify
docker ps --format "{{.Names}}: {{.Status}}"

Open http://localhost in your browser.


📁 Project Structure

lemmy-devops/
├── 📄 docker-compose.yml      # Orchestration + health checks
├── 📄 nginx_internal.conf     # Reverse proxy routing rules
├── 📄 lemmy.hjson             # Lemmy backend configuration
├── 📁 volumes/
│   ├── postgres/              # Database persistent data
│   └── pictrs/                # Media storage
└── 📁 .github/
    └── workflows/             # CI/CD pipelines (Sprint 2)

✅ Health Checks

All services are configured with Docker health checks:

docker ps --format "{{.Names}}: {{.Status}}"

Expected output:

lemmy-proxy-1:     Up X minutes (healthy)
lemmy-lemmy-1:     Up X minutes (healthy)
lemmy-lemmy-ui-1:  Up X minutes (healthy)
lemmy-pictrs-1:    Up X minutes (healthy)
lemmy-postgres-1:  Up X minutes (healthy)

🗺️ Roadmap

Sprint Focus Status
Sprint 1 Docker + Compose + Nginx ✅ Done
Sprint 2 GitHub Actions CI/CD 🔄 In Progress
Sprint 3 Kubernetes + Helm ⏳ Upcoming
Sprint 4 Prometheus + Grafana ⏳ Upcoming

📚 Resources


Built with ❤️ as part of a DevOps learning journey

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors