From 52f7f969118957e035da1f49e5ff4e453a8d3554 Mon Sep 17 00:00:00 2001 From: Meng Sen Date: Mon, 18 Aug 2025 10:22:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=20Immich?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Meng Sen --- apps/immich-machine-learning/1.138.0/data.yml | 61 +++++++++++++++++++ .../1.138.0/docker-compose.yml | 31 ++++++++++ .../1.138.0/envs/default.env | 2 + .../1.138.0/envs/global.env | 2 + .../1.138.0/scripts/init.sh | 17 ++++++ .../1.138.0/scripts/uninstall.sh | 10 +++ .../1.138.0/scripts/upgrade.sh | 17 ++++++ 7 files changed, 140 insertions(+) create mode 100644 apps/immich-machine-learning/1.138.0/data.yml create mode 100644 apps/immich-machine-learning/1.138.0/docker-compose.yml create mode 100644 apps/immich-machine-learning/1.138.0/envs/default.env create mode 100644 apps/immich-machine-learning/1.138.0/envs/global.env create mode 100644 apps/immich-machine-learning/1.138.0/scripts/init.sh create mode 100644 apps/immich-machine-learning/1.138.0/scripts/uninstall.sh create mode 100644 apps/immich-machine-learning/1.138.0/scripts/upgrade.sh diff --git a/apps/immich-machine-learning/1.138.0/data.yml b/apps/immich-machine-learning/1.138.0/data.yml new file mode 100644 index 000000000..7321cde6d --- /dev/null +++ b/apps/immich-machine-learning/1.138.0/data.yml @@ -0,0 +1,61 @@ +additionalProperties: + formFields: + - default: "/home/immich-machine-learning" + edit: true + envKey: IMMICH_ROOT_PATH + labelZh: 数据持久化路径 + labelEn: Data persistence path + required: true + type: text + - default: 2283 + edit: true + envKey: PANEL_APP_PORT_HTTP + labelZh: API 端口 + labelEn: API port + required: true + rule: paramPort + type: number + - default: "/dev/dri" + edit: true + envKey: IMMICH_DRIVE_PATH + labelZh: 硬件驱动路径 + labelEn: Drive path + required: true + type: text + - default: "Asia/Shanghai" + edit: true + envKey: TZ + labelZh: 时区 + labelEn: Timezone + required: true + type: text + - default: "XLM-Roberta-Large-Vit-B-16Plus" + edit: true + envKey: MACHINE_LEARNING_PRELOAD__CLIP + labelEn: Machine Learning Preload Model + labelZh: 机器学习 预加载模型 + required: false + type: text + - default: "buffalo_l" + edit: true + envKey: MACHINE_LEARNING_PRELOAD__FACIAL_RECOGNITION + labelEn: Machine Learning Preload Model + labelZh: 人脸识别 预加载模型 + required: false + type: select + values: + - label: antelopev2 + value: "antelopev2" + - label: buffalo_l + value: "buffalo_l" + - label: buffalo_m + value: "buffalo_m" + - label: buffalo_s + value: "buffalo_s" + - default: "https://hf-mirror.com" + edit: true + envKey: HF_ENDPOINT + labelZh: Hugging Face 服务地址 + labelEn: Hugging Face Endpoint + required: false + type: text diff --git a/apps/immich-machine-learning/1.138.0/docker-compose.yml b/apps/immich-machine-learning/1.138.0/docker-compose.yml new file mode 100644 index 000000000..ac1fd79eb --- /dev/null +++ b/apps/immich-machine-learning/1.138.0/docker-compose.yml @@ -0,0 +1,31 @@ +networks: + 1panel-network: + external: true + +name: immich-machine-learning + +services: + immich-machine-learning: + image: ghcr.io/immich-app/immich-machine-learning:v1.138.0 + container_name: immich-machine-learning-${CONTAINER_NAME} + labels: + createdBy: "Apps" + restart: always + networks: + - 1panel-network + devices: + - /dev/dri:/dev/dri + # - /dev/nvidia0:/dev/nvidia0 + # - /dev/nvidiactl:/dev/nvidiactl + # - /dev/nvidia-modeset:/dev/nvidia-modeset + # - /dev/nvidia-nvswitchctl:/dev/nvidia-nvswitchctl + # - /dev/nvidia-uvm:/dev/nvidia-uvm + # - /dev/nvidia-uvm-tools:/dev/nvidia-uvm-tools + # - /dev/video11:/dev/video11 + ports: + - ${PANEL_APP_PORT_HTTP}:3003 + env_file: + - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env} + - ${ENV_FILE:-/etc/1panel/envs/default.env} + volumes: + - ${IMMICH_ROOT_PATH}/data/cache:/cache diff --git a/apps/immich-machine-learning/1.138.0/envs/default.env b/apps/immich-machine-learning/1.138.0/envs/default.env new file mode 100644 index 000000000..cd05f46e6 --- /dev/null +++ b/apps/immich-machine-learning/1.138.0/envs/default.env @@ -0,0 +1,2 @@ +# copyright© 2024 XinJiang Ms Studio +ENV_FILE=.env diff --git a/apps/immich-machine-learning/1.138.0/envs/global.env b/apps/immich-machine-learning/1.138.0/envs/global.env new file mode 100644 index 000000000..e10989fe4 --- /dev/null +++ b/apps/immich-machine-learning/1.138.0/envs/global.env @@ -0,0 +1,2 @@ +# copyright© 2024 XinJiang Ms Studio +TZ=Asia/Shanghai diff --git a/apps/immich-machine-learning/1.138.0/scripts/init.sh b/apps/immich-machine-learning/1.138.0/scripts/init.sh new file mode 100644 index 000000000..07fb8c3fe --- /dev/null +++ b/apps/immich-machine-learning/1.138.0/scripts/init.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + # setup-1 add default values + CURRENT_DIR=$(pwd) + sed -i '/^ENV_FILE=/d' .env + sed -i '/^GLOBAL_ENV_FILE=/d' .env + echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env + echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/immich-machine-learning/1.138.0/scripts/uninstall.sh b/apps/immich-machine-learning/1.138.0/scripts/uninstall.sh new file mode 100644 index 000000000..c86c4fbca --- /dev/null +++ b/apps/immich-machine-learning/1.138.0/scripts/uninstall.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi diff --git a/apps/immich-machine-learning/1.138.0/scripts/upgrade.sh b/apps/immich-machine-learning/1.138.0/scripts/upgrade.sh new file mode 100644 index 000000000..07fb8c3fe --- /dev/null +++ b/apps/immich-machine-learning/1.138.0/scripts/upgrade.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +if [ -f .env ]; then + source .env + + # setup-1 add default values + CURRENT_DIR=$(pwd) + sed -i '/^ENV_FILE=/d' .env + sed -i '/^GLOBAL_ENV_FILE=/d' .env + echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env + echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env + + echo "Check Finish." + +else + echo "Error: .env file not found." +fi