version: '3.5' # Example Docker Compose config file for PhotoPrism (Linux / AMD64) # PhotoPrism的Docker Compose配置文件示例(Linux/AMD64) # # Note: # - Running PhotoPrism on a server with less than 4 GB of swap space or setting a memory/swap limit can cause unexpected # restarts ("crashes"), for example, when the indexer temporarily needs more memory to process large files. # 在交换空间小于4 GB的服务器上运行PhotoPrism或设置内存/交换限制可能会导致意外重启(“崩溃”),例如,当索引器临时需要更多内存来处理大文件时。 # - If you install PhotoPrism on a public server outside your home network, please always run it behind a secure # HTTPS reverse proxy such as Traefik or Caddy. Your files and passwords will otherwise be transmitted # in clear text and can be intercepted by anyone, including your provider, hackers, and governments: # 如果您在家庭网络之外的公共服务器上安装PhotoPrism,请始终在安全的HTTPS反向代理(如Traefik或Caddy)后面运行。您的文件和密码将以明文形式传输,任何人都可以拦截,包括您的提供商、黑客和政府: # https://docs.photoprism.app/getting-started/proxies/traefik/ # # Setup Guides: # 安装指南: # - https://docs.photoprism.app/getting-started/docker-compose/ # - https://docs.photoprism.app/getting-started/raspberry-pi/ # - https://www.photoprism.app/kb/activation # # Troubleshooting Checklists: # 故障排除检查列表: # - https://docs.photoprism.app/getting-started/troubleshooting/ # - https://docs.photoprism.app/getting-started/troubleshooting/docker/ # - https://docs.photoprism.app/getting-started/troubleshooting/mariadb/ # # CLI Commands: # CLI命令: # - https://docs.photoprism.app/getting-started/docker-compose/#command-line-interface # # All commands may have to be prefixed with "sudo" when not running as root. # 当不是以root用户身份运行时,所有命令可能都必须以“sudo”为前缀。 # This will point the home directory shortcut ~ to /root in volume mounts. # 这将在卷装载中将主目录快捷方式~指向/root。 services: photoprism: ## Use photoprism/photoprism:preview for testing preview builds: ## 使用photoprism/photoprism:测试预览构建的预览: image: photoprism/photoprism:latest ## Don't enable automatic restarts until PhotoPrism has been properly configured and tested! ## 在正确配置和测试PhotoPrism之前,不要启用自动重启! ## If the service gets stuck in a restart loop, this points to a memory, filesystem, network, or database issue: ## 如果服务在重新启动循环中卡住,则表明内存、文件系统、网络或数据库存在问题: ## https://docs.photoprism.app/getting-started/troubleshooting/#fatal-server-errors # restart: unless-stopped # 重新启动:除非停止 stop_grace_period: 10s #停止_跟踪_周期 depends_on: #依赖 - mariadb security_opt: #安全选项 - seccomp:unconfined - apparmor:unconfined #↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ ports: - "2342:2342" # HTTP port (host:container) environment: #环境变量 #↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ PHOTOPRISM_ADMIN_USER: "admin" # admin login username # 管理员用户名 #↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ PHOTOPRISM_ADMIN_PASSWORD: "insecure" # initial admin password (8-72 characters) # 初始管理员密码(8-72个字符) PHOTOPRISM_AUTH_MODE: "password" # authentication mode (public, password) # 身份验证模式(公共、密码) #↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ PHOTOPRISM_SITE_URL: "http://localhost:2342/" # server URL in the format "http(s)://domain.name(:port)/(path)" #站点公共网站URL # 服务器URL,格式为"http://domain.name(:port)/(path)" PHOTOPRISM_DISABLE_TLS: "false" # disables HTTPS/TLS even if the site URL starts with https:// and a certificate is available # 禁用HTTPS/TLS,即使站点URL以HTTPS://开头并且证书可用 PHOTOPRISM_DEFAULT_TLS: "true" # defaults to a self-signed HTTPS/TLS certificate if no other certificate is available # 如果没有其他证书可用,则默认为自签名HTTPS/TLS证书 PHOTOPRISM_ORIGINALS_LIMIT: 5000 # file size limit for originals in MB (increase for high-res video) # 原件的文件大小限制(MB)(高分辨率视频增加)(1-100000;-1 表示禁用) PHOTOPRISM_HTTP_COMPRESSION: "gzip" # improves transfer speed and bandwidth utilization (none or gzip) # 提高传输速度和带宽利用率(none或gzip) PHOTOPRISM_LOG_LEVEL: "info" # log level: trace, debug, info, warning, error, fatal, or panic # 日志级别:跟踪、调试、信息、警告、错误、致命或死机 PHOTOPRISM_READONLY: "false" # do not modify originals directory (reduced functionality) # 只读 -禁用导入、上传、删除以及所有其他需要写入权限的操作 # 不修改原始目录(功能减少) PHOTOPRISM_EXPERIMENTAL: "false" # enables experimental features # 启用实验功能 PHOTOPRISM_DISABLE_CHOWN: "false" # disables updating storage permissions via chmod and chown on startup # 禁止在启动时通过chmod和chown更新存储权限 PHOTOPRISM_DISABLE_WEBDAV: "false" # disables built-in WebDAV server # 禁用内置WebDAV服务器 PHOTOPRISM_DISABLE_SETTINGS: "false" # disables settings UI and API # 禁用设置UI和API PHOTOPRISM_DISABLE_TENSORFLOW: "false" # disables all features depending on TensorFlow # 根据TensorFlow禁用所有功能 PHOTOPRISM_DISABLE_FACES: "false" # disables face detection and recognition (requires TensorFlow) # 禁用人脸检测和识别(需要TensorFlow) PHOTOPRISM_DISABLE_CLASSIFICATION: "false" # disables image classification (requires TensorFlow) # 禁用图像分类(需要TensorFlow) PHOTOPRISM_DISABLE_VECTORS: "false" # disables vector graphics support # 禁用矢量图形支持 PHOTOPRISM_DISABLE_RAW: "false" # disables indexing and conversion of RAW images # 禁用RAW图像的索引和转换 PHOTOPRISM_RAW_PRESETS: "false" # enables applying user presets when converting RAW images (reduces performance) # 启用在转换RAW图像时应用用户预设(降低性能) PHOTOPRISM_JPEG_QUALITY: 85 # a higher value increases the quality and file size of JPEG images and thumbnails (25-100) # 较高的值会增加JPEG图像和缩略图的质量和文件大小(25-100) PHOTOPRISM_DETECT_NSFW: "false" # automatically flags photos as private that MAY be offensive (requires TensorFlow) # 自动将可能具有攻击性的照片标记为私人照片(需要TensorFlow) PHOTOPRISM_UPLOAD_NSFW: "true" # allows uploads that MAY be offensive (no effect without TensorFlow) # 允许可能具有攻击性的上传(没有TensorFlow则无效) # PHOTOPRISM_DATABASE_DRIVER: "sqlite" # SQLite is an embedded database that doesn't require a server #↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ PHOTOPRISM_DATABASE_DRIVER: "mariadb" # use MariaDB 10.5+ or MySQL 8+ instead of SQLite for improved performance #musql8.0不再受支持 # 使用MariaDB 10.5+或MySQL 8+而不是SQLite以提高性能 #↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ PHOTOPRISM_DATABASE_SERVER: "mariadb:3306" # MariaDB or MySQL database server (hostname:port) # MariaDB或MySQL数据库服务器(主机名:端口) #↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ PHOTOPRISM_DATABASE_NAME: "photoprism" # MariaDB or MySQL database schema name # MariaDB或MySQL数据库架构名称 #↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ PHOTOPRISM_DATABASE_USER: "photoprism" # MariaDB or MySQL database user name # MariaDB或MySQL数据库用户名 #↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ PHOTOPRISM_DATABASE_PASSWORD: "insecure" # MariaDB or MySQL database user password # MariaDB或MySQL数据库用户密码 PHOTOPRISM_SITE_CAPTION: "AI-Powered Photos App" #meta site title #站点标题 PHOTOPRISM_SITE_DESCRIPTION: "" # meta site description # 站点描述 PHOTOPRISM_SITE_AUTHOR: "" # meta site author # 网站作者 ## Video Transcoding (https://docs.photoprism.app/getting-started/advanced/transcoding/): ## 视频转码 (https://docs.photoprism.app/getting-started/advanced/transcoding/): # PHOTOPRISM_FFMPEG_ENCODER: "software" # H.264/AVC encoder (software, intel, nvidia, apple, raspberry, or vaapi) # H.264/AVC编码器(软件、英特尔、nvidia、苹果、树莓派或vaapi) # PHOTOPRISM_FFMPEG_SIZE: "1920" # video size limit in pixels (720-7680) (default: 3840) # 视频大小限制(像素)(720-7680)(默认值:3840) # PHOTOPRISM_FFMPEG_BITRATE: "32" # video bitrate limit in Mbit/s (default: 50) # 视频比特率限制(以Mbit/s为单位)(默认值:50) ## Run/install on first startup (options: update https gpu tensorflow davfs clitools clean): ## 首次启动时运行/安装(选项:更新https gpu tensorflow davfs clitools-clean): # PHOTOPRISM_INIT: "https gpu tensorflow" ## Run as a non-root user after initialization (supported: 0, 33, 50-99, 500-600, and 900-1200): ## 初始化后以非root用户身份运行(支持:0、33、50-99、500-600和900-1200): # PHOTOPRISM_UID: 1000 # PHOTOPRISM_GID: 1000 # PHOTOPRISM_UMASK: 0000 ## Start as non-root user before initialization (supported: 0, 33, 50-99, 500-600, and 900-1200): ## 初始化前以非root用户身份启动(支持:0、33、50-99、500-600和900-1200): # user: "1000:1000" ## Share hardware devices with FFmpeg and TensorFlow (optional): ## 与FFmpeg和TensorFlow共享硬件设备(可选): # devices: # - "/dev/dri:/dev/dri" # Intel QSV # - "/dev/nvidia0:/dev/nvidia0" # Nvidia CUDA # - "/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" # Video4Linux Video Encode Device (h264_v4l2m2m) working_dir: "/photoprism" # do not change or remove # 不要更改或删除 ## Storage Folders: "~" is a shortcut for your home directory, "." for the current directory ## 存储文件夹:"~"是主目录的快捷方式,"."表示当前目录 volumes: # "/host/folder:/photoprism/folder" # Example # 例子 #↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ - "~/Pictures:/photoprism/originals" # Original media files (DO NOT REMOVE) # 示例原始媒体文件(不要删除) #我们建议您更改~/Pictures为现有媒体文件所在的目录,例如:- "/mnt/photos:/photoprism/originals" # - "/example/family:/photoprism/originals/family" # *Additional* media folders can be mounted like this # *其他*媒体文件夹可以这样安装 # - "~/Import:/photoprism/import" # *Optional* base folder from which files can be imported to originals # *可选*可将文件导入原始文件夹的基本文件夹 #↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ - "./storage:/photoprism/storage" # *Writable* storage folder for cache, database, and sidecar files (DO NOT REMOVE) # *缓存、数据库和sidecar文件的可写*存储文件夹(不要删除) #需要安装docker版mariadb数据库请取消每行第一位的#注释符号 ## Database Server (recommended) ## 数据库服务器(推荐) ## see https://docs.photoprism.app/getting-started/faq/#should-i-use-sqlite-mariadb-or-mysql mariadb: image: mariadb:10.11 container_name: mariadb ## If MariaDB gets stuck in a restart loop, this points to a memory or filesystem issue: ## 如果MariaDB在重新启动循环中陷入困境,则表明内存或文件系统存在问题: ## https://docs.photoprism.app/getting-started/troubleshooting/#fatal-server-errors restart: unless-stopped stop_grace_period: 5s security_opt: # see https://github.com/MariaDB/mariadb-docker/issues/434#issuecomment-1136151239 - seccomp:unconfined - apparmor:unconfined command: mariadbd --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 ## Never store database files on an unreliable device such as a USB flash drive, an SD card, or a shared network folder: ## 切勿将数据库文件存储在不可靠的设备上,如USB闪存驱动器、SD卡或共享网络文件夹: volumes: #↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ - "./database:/var/lib/mysql" # DO NOT REMOVE # 不要删除,修改数据库存储位置 environment: MARIADB_AUTO_UPGRADE: "1" MARIADB_INITDB_SKIP_TZINFO: "1" MARIADB_DATABASE: "photoprism" MARIADB_USER: "photoprism" #↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ MARIADB_PASSWORD: "insecure" MARIADB_ROOT_PASSWORD: "insecure" #修改数据库密码 #容器自动更新服务,如需启用请取消每行第一位的#注释符号 # # # ## Watchtower upgrades services automatically (optional) # ## Watchtower自动升级服务(可选) # ## see https://docs.photoprism.app/getting-started/updates/#watchtower # ## activate via "COMPOSE_PROFILES=update docker compose up -d" # ## 通过激活 "COMPOSE_PROFILES=update docker compose up -d" # watchtower: # restart: unless-stopped # image: containrrr/watchtower # profiles: ["update"] # environment: # WATCHTOWER_CLEANUP: "true" # WATCHTOWER_POLL_INTERVAL: 7200 # checks for updates every two hours # # 每两小时检查一次更新 # volumes: # - "/var/run/docker.sock:/var/run/docker.sock" # - "~/.docker/config.json:/config.json" # optional, for authentication if you have a Docker Hub account # # 可选,如果您有Docker Hub帐户,则用于身份验证 #