#!/bin/bash set -e # Function for logging log() { echo "[$(date '+%Y-%m-%d %H:%M:%S')] [BASE] $*" } # Function for cleanup cleanup() { log "Performing base installation cleanup..." rm -rf \ /var/lib/apt/lists/* \ /var/tmp/* \ /var/log/* # Don't clean /tmp/* as it may contain installation scripts for other services } # Trap to ensure cleanup on exit trap cleanup EXIT log "Starting base system dependencies installation..." log "Updating package lists..." apt-get update log "Installing essential system dependencies..." apt-get install -y --no-install-recommends \ curl \ ca-certificates \ gnupg \ lsb-release \ wget \ unzip \ tar \ gzip log "Installing process management tools..." apt-get install -y --no-install-recommends \ supervisor \ gettext-base log "Base system installation completed successfully"