Add 26 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:
42
immich/install.sh
Executable file
42
immich/install.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
# shellcheck disable=SC1091
|
||||
source "${AGENT_PATH}/common.sh"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
source "${SCRIPT_DIR}/_volumes.sh"
|
||||
|
||||
_check_required_env_vars "CONTAINER_NAME" "UPLOAD_LOCATION" "DB_DATA_LOCATION" "DB_PASSWORD"
|
||||
|
||||
# Set defaults
|
||||
IMMICH_VERSION="${IMMICH_VERSION:-release}"
|
||||
ML_IMAGE_TAG="${ML_IMAGE_TAG:-release}"
|
||||
WEB_PORT="${WEB_PORT:-2283}"
|
||||
DB_USERNAME="${DB_USERNAME:-postgres}"
|
||||
DB_DATABASE_NAME="${DB_DATABASE_NAME:-immich}"
|
||||
|
||||
# Export all variables for envsubst
|
||||
export CONTAINER_NAME UPLOAD_LOCATION DB_DATA_LOCATION DB_PASSWORD DB_USERNAME DB_DATABASE_NAME
|
||||
export WEB_PORT IMMICH_VERSION ML_IMAGE_TAG
|
||||
|
||||
cd "$SCRIPT_DIR" || _die "Failed to change to script directory"
|
||||
|
||||
# Generate docker-compose.yml from template
|
||||
echo "Generating docker-compose.yml..."
|
||||
envsubst < docker-compose.yml.template > docker-compose.yml \
|
||||
|| _die "Failed to generate docker-compose.yml"
|
||||
|
||||
# Create data directories
|
||||
_create_folder "${UPLOAD_LOCATION}"
|
||||
_create_folder "${DB_DATA_LOCATION}"
|
||||
|
||||
# Pull images
|
||||
echo "Pulling Immich images..."
|
||||
docker compose pull || _die "Failed to pull images"
|
||||
|
||||
# Stop and remove existing containers
|
||||
bash ./stop.sh 2>/dev/null || true
|
||||
|
||||
# Start services
|
||||
bash ./start.sh || _die "Failed to start containers"
|
||||
|
||||
echo "Installation complete for ${CONTAINER_NAME}."
|
||||
echo "Web UI available at http://localhost:${WEB_PORT}"
|
||||
Reference in New Issue
Block a user