Files
infmap/install.sh

23 lines
809 B
Bash
Executable File

#!/bin/bash
source "${AGENT_PATH}/common.sh"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
_check_required_env_vars "CONTAINER_NAME" "WEB_PORT" "SSH_KEY_PATH" "DATA_VOLUME"
_check_docker_installed || _die "Docker test failed"
# Check SSH key exists
[ -f "${SSH_KEY_PATH}" ] || _die "SSH key not found at ${SSH_KEY_PATH}"
# Check infrastructure.conf exists
[ -f "${CONFIG_PATH}/infrastructure.conf" ] || _die "infrastructure.conf not found at ${CONFIG_PATH}/infrastructure.conf"
# Create data volume
docker volume create "${DATA_VOLUME}" 2>/dev/null || true
bash ./stop.sh || true
docker compose -p "${CONTAINER_NAME}" up -d --build || _die "Failed to start services"
echo "Installation of ${CONTAINER_NAME} complete"
echo "Web UI available at http://localhost:${WEB_PORT}"