#!/usr/bin/env bash # Bootstrap a fresh Ubuntu 24.04 LXC for news-platform (news-project-test). # Run as root once after CT creation: bash deploy/lxc/setup.sh set -euo pipefail log() { echo "[lxc-setup] $*"; } export DEBIAN_FRONTEND=noninteractive log "apt update / upgrade..." apt-get update -y apt-get upgrade -y log "installing base packages..." apt-get install -y --no-install-recommends \ ca-certificates curl git gnupg nginx redis-server log "installing Docker..." apt-get install -y --no-install-recommends docker.io docker-compose-plugin systemctl enable --now docker log "Node.js 24 Active LTS (NodeSource)..." curl -fsSL https://deb.nodesource.com/setup_24.x | bash - apt-get install -y nodejs # Target runtime: Node.js 24.22.1 (Active LTS). Verify with: node -v log "PM2 (global)..." npm install -g pm2 log "enabling redis..." systemctl enable --now redis-server log "done. Next: clone repo to /opt/news-platform and run deploy/scripts/deploy.sh"