Initial commit: stack
This commit is contained in:
commit
fe16a07dd7
11 changed files with 2058 additions and 0 deletions
48
infrastructure/lxc-templates/provision-npm.sh
Normal file
48
infrastructure/lxc-templates/provision-npm.sh
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
#!/bin/bash
|
||||
# Provision the NPM LXC — dual-homed (LAN + internal bridge)
|
||||
# Usage: ./provision-npm.sh <lxc-id> <lan-ip> <lan-gateway>
|
||||
# Example: ./provision-npm.sh 103 10.4.0.50 10.4.0.1
|
||||
set -e
|
||||
|
||||
LXC_ID=$1
|
||||
LAN_IP=$2
|
||||
LAN_GW=$3
|
||||
|
||||
if [ -z "$LXC_ID" ] || [ -z "$LAN_IP" ] || [ -z "$LAN_GW" ]; then
|
||||
echo "Usage: $0 <lxc-id> <lan-ip> <lan-gateway>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "==> Creating NPM LXC $LXC_ID (dual-homed)"
|
||||
|
||||
pct create "$LXC_ID" local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst \
|
||||
--hostname "hnf-npm" \
|
||||
--memory 512 \
|
||||
--cores 1 \
|
||||
--rootfs local-lvm:8 \
|
||||
--net0 name=eth0,bridge=vmbr0,ip="${LAN_IP}/22",gw="${LAN_GW}" \
|
||||
--net1 name=eth1,bridge=vmbr1,ip="10.10.10.2/24" \
|
||||
--features nesting=1 \
|
||||
--unprivileged 0 \
|
||||
--start 1
|
||||
|
||||
sleep 5
|
||||
|
||||
pct exec "$LXC_ID" -- bash -c "
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq ca-certificates curl gnupg
|
||||
install -m 0755 -d /etc/apt/keyrings
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||
echo 'deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu jammy stable' \
|
||||
> /etc/apt/sources.list.d/docker.list
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq docker-ce docker-ce-cli containerd.io docker-compose-plugin
|
||||
systemctl enable docker
|
||||
"
|
||||
|
||||
echo ""
|
||||
echo "==> NPM LXC ready"
|
||||
echo " LAN: $LAN_IP (vmbr0)"
|
||||
echo " Internal: 10.10.10.2 (vmbr1)"
|
||||
echo " Next: deploy Nginx Proxy Manager via docker compose"
|
||||
echo " NPM admin UI will be at http://$LAN_IP:81"
|
||||
Loading…
Add table
Add a link
Reference in a new issue