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”


隨機文章

隨機美圖

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *