參考資料
https://www.kwchang0831.dev/photoprism
https://ivonblog.com/posts/self-hosting-photo-prism-docker/
官方文件就有針對Synology群輝NAS製作的教學,很棒!
https://docs.photoprism.app/getting-started/nas/synology/
安裝前注意事項
由於Photoprism要求的MariaDB版本最低10.6,不幸的是群暉內建的版本是10.3 囧...,所以我們需要另外建一個資料庫,這邊我選用先前架設的postgresSQL(架設筆記)。
首先先進入DSM,在docker目錄下建兩個資料夾,參考下圖
接下來登入postgresadmin管理網頁(需要自架),新增一個空資料庫photoprism,記得指派帳號
接著登入portainer,新增stack
version: '3.9'
services:
photoprism:
image: photoprism/photoprism
ports:
- 2342:2342 # Default HTTP port (host:container)
volumes:
- /volume1/docker/photoprism/storage:/photoprism/storage
- /volume1/docker/photoprism/photo:/photoprism/originals
environment:
- PHOTOPRISM_UPLOAD_NSFW=true
- TZ=Asia/Taipei
- PHOTOPRISM_ADMIN_USER=*** # 管理員帳號
- PHOTOPRISM_ADMIN_PASSWORD=*** # 管理員密碼
- PHOTOPRISM_UID=1026 # user id, should match your host user id
- PHOTOPRISM_GID=100 # group id
- PHOTOPRISM_DATABASE_DRIVER=postgres
- PHOTOPRISM_DATABASE_SERVER=PostgreSQL:5432
- PHOTOPRISM_DATABASE_NAME=photoprism
- PHOTOPRISM_DATABASE_USER=***
- PHOTOPRISM_DATABASE_PASSWORD=***
security_opt:
- seccomp=unconfined
- apparmor=unconfined
networks:
- postgresql #使photoprism位於postgresql同網路,這樣才能連接資料庫
networks:
postgresql:
external:
name: postgresql_default
部署會花點時間,視NAS硬體能力不定,之後輸入 http://NASIP:2342 如果前面都無誤便可以看到相簿啦