add database stack

This commit is contained in:
Bray 2026-03-26 18:07:39 -04:00
parent ff04275352
commit 5e5a365307
2 changed files with 91 additions and 0 deletions

View file

@ -0,0 +1,26 @@
version: '3.8'
services:
postgres:
image: postgres:17
container_name: mystic-postgres
restart: unless-stopped
environment:
POSTGRES_PASSWORD: Nyhjew-didvot-zypsa7
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
mongodb:
image: mongo:latest
container_name: mystic-mongo
restart: unless-stopped
volumes:
- mongo_data:/data/db
ports:
- "27017:27017"
volumes:
postgres_data:
mongo_data:

65
setup-commands.md Normal file
View file

@ -0,0 +1,65 @@
# 🛠️ Mystic Stack: Node Onboarding Guide
Remove any standalone `node_exporter` installations to avoid port conflicts on `9100`.
```bash
sudo systemctl stop node_exporter
sudo systemctl disable node_exporter
sudo rm /etc/systemd/system/node_exporter.service
sudo systemctl daemon-reload
# Install dependencies
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg git -y
# Add Dockers official GPG key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL [https://download.docker.com/linux/ubuntu/gpg](https://download.docker.com/linux/ubuntu/gpg) | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add the repository to Apt sources
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] [https://download.docker.com/linux/ubuntu](https://download.docker.com/linux/ubuntu) \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install Docker Stack
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
# Install dependencies
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg git -y
# Add Dockers official GPG key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL [https://download.docker.com/linux/ubuntu/gpg](https://download.docker.com/linux/ubuntu/gpg) | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add the repository to Apt sources
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] [https://download.docker.com/linux/ubuntu](https://download.docker.com/linux/ubuntu) \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Install Docker Stack
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
sudo usermod -aG docker $USER
newgrp docker
# Generate key (Press Enter for all prompts)
ssh-keygen -t ed25519 -C "$(hostname)"
# Output public key for Forgejo Web UI
cat ~/.ssh/id_ed25519.pub
# Setup Directory
mkdir -p ~/mystic-stack && cd ~/mystic-stack
# Clone Repository (Using Tailscale IP of Git VM)
git clone git@100.98.158.31:bray/infra.git .
# Launch Node Exporter
docker compose -f nodes/docker-compose.node.yml up -d