version: "3.8"
name: immich
services:
immich-server:
container_name: immich_server
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
# 如果怕修改原有照片,最后加上ro,否则删除ro
- ${PHOTOS_LOCATION}:/usr/src/app/external:ro
- /etc/localtime:/etc/localtime:ro
env_file:
- .env
ports:
- 2283:3001
depends_on:
- redis
- database
restart: always
immich-machine-learning:
container_name: immich_machine_learning
# 不同硬件可以在镜像后增加[armnn, cuda, openvino] 标签,比如支持cuda的独立显卡加速,可以为 ${IMMICH_VERSION:-release}-cuda
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
# 下面的代码开启核显转码加速
# devices:
# - /dev/dri:/dev/dri
volumes:
# 这个目录存放AI模型
- /volume1/docker/immich/model:/cache
restart: always
redis:
container_name: immich_redis
image: library/redis:6.2-alpine
restart: always
database:
container_name: immich_postgres
image: tensorchord/pgvecto-rs:pg14-v0.2.0
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME}
POSTGRES_INITDB_ARGS: '--data-checksums'
volumes:
#自定义data位置
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
restart: always
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"]
同一个路径下,增加【.env】文件,代码如下
TZ=Asia/Shanghai
IMMICH_VERSION=release
HF_ENDPOINT=https://hf-mirror.com
# 自定义的上传照片存放路径,群晖需要先创建好
UPLOAD_LOCATION=./library
# 自定义的数据库存放路径,群晖需要先创建好
DB_DATA_LOCATION=./postgres
# 自定义的外部库存放路径
PHOTOS_LOCATION=/volume1/homes/name/Photos/
# 下面修改数据库账号密码等信息
DB_PASSWORD=postgres
DB_USERNAME=postgres
DB_DATABASE_NAME=immich
评论区