Add 16 files
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 8s
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 8s
This commit is contained in:
21
caddy-static/install.sh
Executable file
21
caddy-static/install.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
# shellcheck disable=SC1091
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
|
||||
_check_required_env_vars "CONTAINER_NAME" "HTTP_PORT" "STATIC_DIR"
|
||||
|
||||
# Verify static directory exists
|
||||
[ -d "${STATIC_DIR}" ] || _die "Static directory does not exist: ${STATIC_DIR}"
|
||||
|
||||
# Pull the image
|
||||
echo "Pulling Caddy image..."
|
||||
docker pull caddy:alpine || _die "Failed to pull Caddy image"
|
||||
|
||||
# Stop existing container if running
|
||||
bash "$(dirname "${BASH_SOURCE[0]}")/stop.sh" 2>/dev/null || true
|
||||
|
||||
# Start the service
|
||||
bash "$(dirname "${BASH_SOURCE[0]}")/start.sh" || _die "Failed to start container"
|
||||
|
||||
echo "Installation complete for ${CONTAINER_NAME}."
|
||||
echo "Static files served at http://localhost:${HTTP_PORT}"
|
||||
Reference in New Issue
Block a user