Update immich/install.sh
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:
@@ -14,22 +14,26 @@ WEB_PORT="${WEB_PORT:-2283}"
|
|||||||
DB_USERNAME="${DB_USERNAME:-postgres}"
|
DB_USERNAME="${DB_USERNAME:-postgres}"
|
||||||
DB_DATABASE_NAME="${DB_DATABASE_NAME:-immich}"
|
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"
|
cd "$SCRIPT_DIR" || _die "Failed to change to script directory"
|
||||||
|
|
||||||
# Generate docker-compose.yml from template
|
# Generate docker-compose.yml from template using sed
|
||||||
echo "Generating docker-compose.yml..."
|
echo "Generating docker-compose.yml..."
|
||||||
envsubst < docker-compose.yml.template > docker-compose.yml \
|
sed -e "s|\${CONTAINER_NAME}|${CONTAINER_NAME}|g" \
|
||||||
|
-e "s|\${UPLOAD_LOCATION}|${UPLOAD_LOCATION}|g" \
|
||||||
|
-e "s|\${DB_DATA_LOCATION}|${DB_DATA_LOCATION}|g" \
|
||||||
|
-e "s|\${DB_PASSWORD}|${DB_PASSWORD}|g" \
|
||||||
|
-e "s|\${DB_USERNAME}|${DB_USERNAME}|g" \
|
||||||
|
-e "s|\${DB_DATABASE_NAME}|${DB_DATABASE_NAME}|g" \
|
||||||
|
-e "s|\${WEB_PORT}|${WEB_PORT}|g" \
|
||||||
|
-e "s|\${IMMICH_VERSION}|${IMMICH_VERSION}|g" \
|
||||||
|
-e "s|\${ML_IMAGE_TAG}|${ML_IMAGE_TAG}|g" \
|
||||||
|
docker-compose.yml.template > docker-compose.yml \
|
||||||
|| _die "Failed to generate docker-compose.yml"
|
|| _die "Failed to generate docker-compose.yml"
|
||||||
|
|
||||||
# Add GPU configuration if enabled
|
# Add GPU configuration if enabled
|
||||||
if [ "$ML_GPU_ENABLED" = "true" ]; then
|
if [ "$ML_GPU_ENABLED" = "true" ]; then
|
||||||
echo "Enabling GPU acceleration..."
|
echo "Enabling GPU acceleration..."
|
||||||
GPU_CONFIG=" devices:\n - /dev/dri:/dev/dri"
|
sed -i 's|#GPU_PLACEHOLDER#| devices:\n - /dev/dri:/dev/dri|' docker-compose.yml
|
||||||
sed -i "s|#GPU_PLACEHOLDER#|${GPU_CONFIG}|" docker-compose.yml
|
|
||||||
else
|
else
|
||||||
# Remove the placeholder
|
# Remove the placeholder
|
||||||
sed -i '/#GPU_PLACEHOLDER#/d' docker-compose.yml
|
sed -i '/#GPU_PLACEHOLDER#/d' docker-compose.yml
|
||||||
|
|||||||
Reference in New Issue
Block a user