Skip to content

Repository files navigation

🚀 DevOps Home Lab

CI Docker Compose License: MIT

Ambiente DevOps completo rodando localmente em um notebook i5 10ª geração com 16 GB RAM.
Sem servidor dedicado. Sem custo de cloud. 100% prático.

Ambiente completo


📋 Stack

Categoria Ferramenta Versão Porta
Versionamento GitLab CE latest 8929
CI/CD GitLab Runner latest
Monitoramento Zabbix Server 6.4 10051
Monitoramento Zabbix Web 6.4 8090
Métricas Prometheus latest
Dashboards Grafana latest 3000
Banco de dados PostgreSQL 15 5432
AWS simulada MiniStack latest 4566
Console AWS StackPort latest 8080
Object Store MinIO latest 9001
Aplicação Task Manager (Flask) v1 + staging 5000

☁️ AWS simulada com MiniStack

O MiniStack emula 35+ serviços AWS localmente na porta 4566, sem custo e sem conta AWS.

StackPort Console AWS

Serviços utilizados neste lab:

  • ECR — repositório de imagens Docker
  • ECS — orquestração de containers
  • S3 — armazenamento de objetos
  • DynamoDB — banco NoSQL
  • SQS / SNS — filas e notificações
  • Lambda — funções serverless
  • CloudWatch — logs e métricas
  • IAM / STS — gerenciamento de identidade

📊 Monitoramento & Observabilidade

Zabbix

Zabbix Monitoramento

Grafana

Grafana Dashboard


🦊 GitLab CE

GitLab Dashboard


🪣 Object Store — MinIO

MinIO Bucket S3


🐳 Pré-requisitos

  • Docker Engine 24+
  • Docker Compose v2+
  • AWS CLI
  • 8 GB RAM disponível (16 GB recomendado)
  • Linux / WSL2

▶️ Como subir o ambiente (Docker Compose)

Opção 1: Stack leve (MiniStack + MinIO + Grafana + Prometheus) — ~2 GB RAM

docker compose up -d ministack minio grafana prometheus

Opção 2: Stack completa (todos os serviços) — ~8 GB RAM

docker compose up -d

3. Configurar credenciais AWS (fake)

aws configure
# AWS Access Key ID: test
# AWS Secret Access Key: test
# Default region: us-east-1
# Output format: json

4. Acessar os serviços

Serviço URL Credenciais
GitLab http://localhost:8929 root / (definido no setup)
Grafana http://localhost:3000 admin / admin
Zabbix http://localhost:8090 Admin / zabbix
MinIO Console http://localhost:9001 test / testtest
StackPort (AWS UI) http://localhost:8080
MiniStack (AWS API) http://localhost:4566

✅ CI Pipeline

Todo push/PR roda validação automática no GitHub Actions:

  • Syntax checkdocker compose config, Hadolint, ShellCheck
  • Smoke test — Sobe stack leve e testa health endpoints:
    • MiniStack: http://localhost:4566/_localstack/health
    • MinIO: http://localhost:9001/minio/health/live
    • Grafana: http://localhost:3000/api/health
    • Prometheus: http://localhost:9090/-/healthy

Ver runs recentes


🔬 Lab 5 — Deploy do Task Manager no ECS

ECR Task Manager Images

# Criar repositório ECR
aws --endpoint-url=http://localhost:4566 ecr create-repository \
  --repository-name task-manager

# Login no ECR
aws --endpoint-url=http://localhost:4566 ecr get-login-password \
  --region us-east-1 | docker login \
  --username AWS --password-stdin localhost:4566

# Taguear e enviar imagens
docker tag task-manager:v1 localhost:4566/task-manager:v1
docker tag task-manager:staging localhost:4566/task-manager:staging
docker push localhost:4566/task-manager:v1
docker push localhost:4566/task-manager:staging

# Criar cluster ECS
aws --endpoint-url=http://localhost:4566 ecs create-cluster \
  --cluster-name lab-cluster

# Registrar task definition
aws --endpoint-url=http://localhost:4566 ecs register-task-definition \
  --family task-manager \
  --network-mode bridge \
  --container-definitions '[
    {
      "name": "task-manager",
      "image": "localhost:4566/task-manager:v1",
      "memory": 512,
      "cpu": 256,
      "essential": true,
      "portMappings": [{"containerPort": 5000, "hostPort": 5000}],
      "environment": [
        {"name": "FLASK_APP", "value": "run.py"},
        {"name": "FLASK_ENV", "value": "production"}
      ]
    }
  ]'

# Criar serviço
aws --endpoint-url=http://localhost:4566 ecs create-service \
  --cluster lab-cluster \
  --service-name task-manager-svc \
  --task-definition task-manager \
  --desired-count 1

💡 S3 Buckets criados

S3 Buckets


📊 Consumo de recursos

Docker Stats

Container CPU RAM
GitLab ~7% ~5.3 GB
MiniStack ~7% ~126 MB
Grafana ~1% ~145 MB
Zabbix Server ~0.5% ~47 MB
Zabbix Web ~0.03% ~66 MB
PostgreSQL ~0.5% ~94 MB
StackPort ~0.24% ~498 MB
MinIO ~0% ~77 MB

🌐 Acessos

Serviço URL Credenciais
GitLab http://localhost:8929 root / (definido no setup)
Grafana http://localhost:3000 admin / admin
Zabbix http://localhost:8090 Admin / zabbix
MinIO Console http://localhost:9001 test / testtest
StackPort (AWS UI) http://localhost:8080
MiniStack (AWS API) http://localhost:4566

📚 Referências


👤 Autor

Luciano Veiga
LinkedIn: linkedin.com/in/lucianoveiga-ti


📄 Licença

MIT License — fique à vontade para usar, adaptar e melhorar.

About

Problema: Subir lab DevOps completo (GitLab, Zabbix, Grafana, AWS local) exige múltiplos docker run manuais e configuração complexa. Solução: Stack única via docker compose up -d com healthchecks, portas padronizadas e MiniStack (AWS local) integrada. Stack: Docker Compose, GitLab CE, Zabbix 6.4, Grafana, Prometheus, MinIO, MiniStack, PostgreSQL

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors