|
本帖最后由 Nestor 于 2024-10-14 11:00 编辑
1.首先复制原有immich的uoload目录到飞牛
2.复制原volumes到飞牛的volumes(包含my-immich_model-cache和my-immich_pgdata)
这一步看需求,不复制需要重建重新识别图片和进行头像等的机器识别
a. 开启ssh,sudo i进入root用户
b. 使用cp命令(或其他方式)复制原immich的volumes到fnos的你的volumes(我的是/vol2/docker/volumes,vol2为第二块存储,对应你的设置的docker存储位置)
3.创建.env文件 (UPLOAD_LOCATION改成你复制过去的目录)
- # You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables
- # The location where your uploaded files are stored
- UPLOAD_LOCATION=/vol2/1000/docker-data/immich-app/upload
- # The Immich version to use. You can pin this to a specific version like "v1.71.0"
- IMMICH_VERSION=release
- # Connection secret for postgres. You should change it to a random password
- DB_PASSWORD=postgres
- # The values below this line do not need to be changed
- ###################################################################################
- DB_HOSTNAME=immich_postgres
- DB_USERNAME=postgres
- DB_DATABASE_NAME=immich
- REDIS_HOSTNAME=immich_redis
- # IMMICH_WEB_URL=http://immich-web:3000
- # IMMICH_SERVER_URL=http://immich-server:3001
- # IMMICH_MACHINE_LEARNING_URL=http://immich-machine-learning:3003
复制代码
4.在docker应用中创建docker compose,目录选自己复制过去的目录
5.编写docker compose( image: "ghcr.io/immich-app/xxx"可以改为国内加速镜像的)
注意有核显的加上devices: - /dev/dri:/dev/dri 以便开启硬件转码
- name: my-immich
- services:
- immich-server:
- container_name: immich_server
- image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
- devices:
- - /dev/dri:/dev/dri
- volumes:
- - ${UPLOAD_LOCATION}:/usr/src/app/upload
- - /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
- image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
- volumes:
- - model-cache:/cache
- env_file:
- - .env
- restart: always
- redis:
- container_name: immich_redis
- image: redis:6.2-alpine@sha256:b6124ab2e45cc332e16398022a411d7e37181f21ff7874835e0180f56a09e82a
- restart: always
- database:
- container_name: immich_postgres
- image: tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
- env_file:
- - .env
- environment:
- POSTGRES_PASSWORD: ${DB_PASSWORD}
- POSTGRES_USER: ${DB_USERNAME}
- POSTGRES_DB: ${DB_DATABASE_NAME}
- volumes:
- - pgdata:/var/lib/postgresql/data
- restart: always
- volumes:
- pgdata:
- model-cache:
复制代码
7.记得开启immich的硬件转码
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|