放棄PhotoPrism 改用 immich

放棄PhotoPrism 改用 immich

PhotoPrism相簿系統中,有一些功能沒有,而immich有,而且PhotoPrism操作,不如immich直接。所以,我就把PhotoPrism移掉,改用immich
一樣,是使用Docker Compose

name: immich

services:
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
# extends:
#   file: hwaccel.transcoding.yml
#   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
volumes:
# Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
– ${UPLOAD_LOCATION}:/usr/src/app/upload
– /etc/localtime:/etc/localtime:ro
env_file:
– .env
ports:
– ‘2283:2283’
depends_on:
– redis
– database
restart: always
healthcheck:
disable: false

immich-machine-learning:
container_name: immich_machine_learning
# For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
# Example tag: ${IMMICH_VERSION:-release}-cuda
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
# extends: # uncomment this section for hardware acceleration – see https://immich.app/docs/features/ml-hardware-acceleration
#   file: hwaccel.ml.yml
#   service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference – use the `-wsl` version for WSL2 where applicable
volumes:
– model-cache:/cache
env_file:
– .env
restart: always
healthcheck:
disable: false

redis:
container_name: immich_redis
image: docker.io/redis:6.2-alpine@sha256:2ba50e1ac3a0ea17b736ce9db2b0a9f6f8b85d4c27d5f5accc6a416d8f42c6d5
healthcheck:
test: redis-cli ping || exit 1
restart: always

database:
container_name: immich_postgres
image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_INITDB_ARGS: ‘–data-checksums’
volumes:
# Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
– ${DB_DATA_LOCATION}:/var/lib/postgresql/data
healthcheck:
test: pg_isready –dbname=’${DB_DATABASE_NAME}’ –username=’${DB_USERNAME}’ || exit 1; Chksum=”$$(psql –dbname=’${DB_DATABASE_NAME}’ –username=’${DB_USERNAME}’ –tuples-only –no-align –command=’SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database’)”; echo “checksum failure count is $$Chksum”; [ “$$Chksum” = ‘0’ ] || exit 1
interval: 5m
start_interval: 30s
start_period: 5m
command:
[
‘postgres’,
‘-c’,
‘shared_preload_libraries=vectors.so’,
‘-c’,
‘search_path=”$$user”, public, vectors’,
‘-c’,
‘logging_collector=on’,
‘-c’,
‘max_wal_size=2GB’,
‘-c’,
‘shared_buffers=512MB’,
‘-c’,
‘wal_compression=on’,
]
restart: always

volumes:
model-cache:

—-
環境變數要加外建 .env
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION=./library
# The location where your database files are stored
DB_DATA_LOCATION=./postgres

# To set a timezone, uncomment the next line and change Etc/UTC to a TZ identifier from this list: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List
# TZ=Etc/UTC

# The Immich version to use. You can pin this to a specific version like “v1.71.0”
IMMICH_VERSION=release

# Connection secret for postgres. You should change it to a random password
# Please use only the characters `A-Za-z0-9`, without special characters or spaces
DB_PASSWORD=postgres

# The values below this line do not need to be changed
###################################################################################
DB_USERNAME=postgres
DB_DATABASE_NAME=immich

PhotoPrism + MariaDB Docker Compose

PhotoPrism + MariaDB Docker Compose

PhotoPrism使用Docker可以快速部署,我自已是用Openmediavault compose套件

PhotoPrism官方並沒有整合MariaDB或是MySQL,OMV為了要隔離OS與APP的關係,所以我做了下面這個整合的 PhotoPrism+MariaDB Compos

services:
  photoprism:
    image: photoprism/photoprism:latest
    stop_grace_period: 10s
    depends_on:
      – mariadb
    security_opt:
      – seccomp:unconfined
      – apparmor:unconfined
    ports:
      – “2342:2342”
    environment:
      PHOTOPRISM_ADMIN_USER: “admin”
      PHOTOPRISM_ADMIN_PASSWORD: “insecure”
      PHOTOPRISM_AUTH_MODE: “password”
      PHOTOPRISM_SITE_URL: “http://localhost:2342/”
      PHOTOPRISM_DISABLE_TLS: “false”
      PHOTOPRISM_DEFAULT_TLS: “true”
      PHOTOPRISM_ORIGINALS_LIMIT: 5000
      PHOTOPRISM_HTTP_COMPRESSION: “gzip”
      PHOTOPRISM_LOG_LEVEL: “info”
      PHOTOPRISM_DATABASE_DRIVER: “mysql”
      PHOTOPRISM_DATABASE_SERVER: “mariadb:3306”
      PHOTOPRISM_DATABASE_NAME: “photoprism”
      PHOTOPRISM_DATABASE_USER: “photoprism”
      PHOTOPRISM_DATABASE_PASSWORD: “insecure”
      PHOTOPRISM_SITE_CAPTION: “AI-Powered Photos App”
    working_dir: “/photoprism”
    volumes:
      – “~/Pictures:/photoprism/originals”
      – “./storage:/photoprism/storage”

  mariadb:
    image: mariadb:11
    restart: unless-stopped
    stop_grace_period: 5s
    security_opt:
      – seccomp:unconfined
      – apparmor:unconfined
    command: –innodb-buffer-pool-size=512M –transaction-isolation=READ-COMMITTED –character-set-server=utf8mb4 –collation-server=utf8mb4_unicode_ci –max-connections=512 –innodb-rollback-on-timeout=OFF –innodb-lock-wait-timeout=120
    volumes:
      – “./database:/var/lib/mysql”
    environment:
      MARIADB_AUTO_UPGRADE: “1”
      MARIADB_INITDB_SKIP_TZINFO: “1”
      MARIADB_DATABASE: “photoprism”
      MARIADB_USER: “photoprism”
      MARIADB_PASSWORD: “insecure”
      MARIADB_ROOT_PASSWORD: “insecure”

  watchtower:
    restart: unless-stopped
    image: containrrr/watchtower
    profiles: [“update”]
    environment:
      WATCHTOWER_CLEANUP: “true”
      WATCHTOWER_POLL_INTERVAL: 7200
    volumes:
      – “/var/run/docker.sock:/var/run/docker.sock”
      – “~/.docker/config.json:/config.json” # optional, for authentication if needed

需修改的部份
      PHOTOPRISM_ADMIN_PASSWORD: “insecure”
修改 photoprism web界面 admin 帳號的預設密碼

      PHOTOPRISM_DATABASE_NAME: “photoprism”
      PHOTOPRISM_DATABASE_USER: “photoprism”
      PHOTOPRISM_DATABASE_PASSWORD: “insecure”
修改 連接 Mariadb 的資料庫、使用者、密碼

    volumes:
      – “~/Pictures:/photoprism/originals”
修改 圖片存放的路徑
      – “./storage:/photoprism/storage”
修改 快取等資料的路徑

      MARIADB_DATABASE: “photoprism”
      MARIADB_USER: “photoprism”
      MARIADB_PASSWORD: “insecure”
      MARIADB_ROOT_PASSWORD: “insecure”
MariaDB的資料庫/使用者/密碼/Root的密碼


選擇性修改的部份
photoprism對外的連接port
    ports:
      – “2342:2342”


在Linux中安裝 qbittorrent 直接指定連接Port

因為先前是在Openmediavault中安裝Docker再使用Portainer進行管理各個容器
qbittorrent, AdGuard和portainer都是image來包容器
佔用了很多的磁碟空間
由於我VM只有30G,加上Log很快空間就不夠用了
沒有空間的情況下,Openmedaivault就無法登入
所以,把docker容器的服務進行VM的安裝

qbittorrent和qbittorrent-nox是不同的
docker容器中裝的就是qbittorrent-nox
直接透過Web UI進行管理
由於OMV沒有GUI,就不裝qbittorrent,直接裝qbittorrent-nox
指定port和下載路徑,就可以直接使用了

Read more

OMV 6 , Docker / Portainer 差異蠻大的

Openmediavault(以下簡稱OMV),以往只要安裝omv-extras後,可以快速的啟用portainer進行docker image / conatiner的管理。

到了OMV6之後,卻相對麻煩許多
1.安裝omv-extra
2.到服務中啟用compose
需設定相關的存放路徑
3.執行docker指令
我習慣使用9000 port,我的指令如下
docker run -d -p 8000:8000 -p 9000:9443 –name portainer –restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest

接下來,就是使用瀏覽器去做portainer的管理