「Immich」那年那天那些事
目录
私人相册 Immich 服务的运维记录。
部署
当前采用 Docker 容器部署方案,其 docker compose 配置参考官方配置,并做如下调整
name: immich
services:
immich-server:
# ...
networks: # 接入 traefik 网络
- traefik_proxy
- default # 保留默认网络
# ...
labels: # 直接暴露,避免 `Forward Auth` ,建议走 `OIDC`
- "traefik.enable=true"
- "traefik.docker.network=traefik_proxy"
- "traefik.http.routers.immich.rule=Host(`memo.aio.yirami.xyz`)"
- "traefik.http.routers.immich.entrypoints=websecure"
- "traefik.http.routers.immich.tls=true"
- "traefik.http.routers.immich.tls.certresolver=le"
- "traefik.http.services.immich.loadbalancer.server.port=2283"
# ...
# ports: # 不对外暴露端口,仅用于调试
# - '2283:2283'
# ...
restart: unless-stopped
deploy:
resources:
limits:
cpus: '1.5'
memory: 1500M
# ...
redis:
# ...
image: docker.io/valkey/valkey:9 # 去除 hash
# ...
restart: unless-stopped
deploy:
resources:
limits:
cpus: '0.2'
memory: 128M
database:
# ...
image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0 # 去除 hash
# ...
restart: unless-stopped
deploy:
resources:
limits:
cpus: '1.5'
memory: 1536M
# ...
networks: # 声明外部网络
traefik_proxy:
external: true调教
1. 调整后台任务并发数
- 登录
Immich网页端 ->系统管理->设置->任务设置 - 并发全部改为 $1$
2. 优化视频转码与硬件加速
- 登录
Immich网页端 ->系统管理->设置->视频转码设置 - 转码策略改为:
不转码任何视频,...