30 lines
1.0 KiB
Bash
30 lines
1.0 KiB
Bash
|
|
#!/usr/bin/env bash
|
||
|
|
# Provision container 10130 (dbis-frontend): nginx, /opt/dbis-core, Node.js
|
||
|
|
# Run on Proxmox host or via ssh. Use before deploy-dbis-frontend-to-container.sh if container is minimal.
|
||
|
|
# Version: 2026-01-31
|
||
|
|
|
||
|
|
set -euo pipefail
|
||
|
|
|
||
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||
|
|
source "${SCRIPT_DIR}/../lib/load-project-env.sh"
|
||
|
|
|
||
|
|
VMID="${VMID_DBIS_FRONTEND:-10130}"
|
||
|
|
PROXMOX_HOST="$(get_host_for_vmid "$VMID")"
|
||
|
|
SSH_OPTS="-o ConnectTimeout=30 -o ServerAliveInterval=60 -o ServerAliveCountMax=3"
|
||
|
|
|
||
|
|
echo "=== Provision DBIS Frontend Container $VMID ==="
|
||
|
|
echo "Host: $PROXMOX_HOST"
|
||
|
|
|
||
|
|
ssh $SSH_OPTS "root@${PROXMOX_HOST}" "
|
||
|
|
pct exec $VMID -- bash -c '
|
||
|
|
export DEBIAN_FRONTEND=noninteractive
|
||
|
|
apt-get update -qq && apt-get install -y -qq nginx curl
|
||
|
|
mkdir -p /opt/dbis-core/frontend/dist
|
||
|
|
systemctl enable nginx
|
||
|
|
systemctl start nginx
|
||
|
|
echo Provisioned: nginx, /opt/dbis-core/frontend/dist
|
||
|
|
'
|
||
|
|
"
|
||
|
|
echo "Done. Run deploy-dbis-frontend-to-container.sh to deploy the build."
|