Skip to content

William-Edwards-STFC/infrastructure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Infrastructure

Docker Compose stack for the AFK bot and portfolio site. Runs on a single VPS with automatic HTTPS via Caddy and Let's Encrypt.

Services

Service Description
caddy Reverse proxy, handles TLS termination
grafana Dashboards and log explorer
prometheus Metrics scraping from afkbot :9090
loki Log aggregation
promtail Reads Docker container logs and ships to Loki
afkbot Mineflayer AFK bot managing 16 accounts
landing-page Next.js portfolio site

Prerequisites

  • Docker and Docker Compose installed on the VPS
  • DNS A records pointing to the VPS IP:
    • williamedwards.me
    • grafana.williamedwards.me

Setup

  1. Clone all three repos alongside each other:
~/
  afkbot/
  infrastructure/
  landing-page/
  1. Create a .env file in this directory:
DOMAIN=williamedwards.me
GRAFANA_PASSWORD=changeme
ADMIN_PASSWORD=changeme
  1. Start the stack:
docker compose up -d
  1. On first run, copy Microsoft auth tokens into the persistent volume so bots don't need to re-authenticate:
cp -r /root/.minecraft/nmp-cache/ /var/lib/docker/volumes/infrastructure_auth_cache/_data/

Useful commands

# View logs for a service
docker compose logs -f afkbot

# Rebuild and restart a single service
docker compose up -d --build landing-page

# Restart everything
docker compose restart

# Stop everything
docker compose down

Volumes

All state is stored in named Docker volumes so it survives container restarts and VPS reboots:

  • caddy_data — TLS certificates
  • grafana_data — dashboards and data sources
  • prometheus_data — metrics (30-day retention)
  • loki_data — logs
  • auth_cache — Microsoft OAuth tokens for the bots (/root/.minecraft)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors