Add Immich template with NVIDIA GPU acceleration support
This commit is contained in:
parent
a8c22c8267
commit
b972e3fe07
4 changed files with 149 additions and 0 deletions
10
.env.sample
10
.env.sample
|
|
@ -69,6 +69,16 @@ BASE_URL=
|
|||
SECRET_KEY=
|
||||
USER_DB_URI=
|
||||
|
||||
# Immich
|
||||
# Photo upload location: keep this on the NFS-backed storage for persistence.
|
||||
IMMICH_UPLOAD_LOCATION=/mnt/unas/arr-data/immich
|
||||
IMMICH_VERSION=release
|
||||
IMMICH_DB_PASSWORD=
|
||||
IMMICH_DB_USERNAME=immich
|
||||
IMMICH_DB_DATABASE_NAME=immich
|
||||
IMMICH_DB_HOSTNAME=immich-postgres
|
||||
IMMICH_REDIS_HOSTNAME=immich-redis
|
||||
|
||||
OIDC_ISSUER=
|
||||
OIDC_CLIENT_ID=
|
||||
OIDC_CLIENT_SECRET=
|
||||
|
|
|
|||
51
docker-compose-files/immich/README.md
Normal file
51
docker-compose-files/immich/README.md
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
# Immich
|
||||
|
||||
Self-hosted photo and video management solution with high performance and visual aesthetics.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- **NVIDIA GPU:** This template is configured for NVIDIA GPU acceleration (RTX A400).
|
||||
- **Proxmox LXC:** Must be a **Privileged** LXC with NVIDIA drivers and Container Toolkit installed.
|
||||
- **Storage:** NFS-backed storage for photo uploads is recommended.
|
||||
|
||||
## Deployment
|
||||
|
||||
1. **Update `.env`**:
|
||||
Ensure the Immich variables are set in your root `.env` file:
|
||||
```dotenv
|
||||
IMMICH_UPLOAD_LOCATION=/mnt/unas/arr-data/immich
|
||||
IMMICH_VERSION=release
|
||||
IMMICH_DB_PASSWORD=<your-secure-password>
|
||||
IMMICH_DB_USERNAME=immich
|
||||
IMMICH_DB_DATABASE_NAME=immich
|
||||
IMMICH_DB_HOSTNAME=immich-postgres
|
||||
IMMICH_REDIS_HOSTNAME=immich-redis
|
||||
```
|
||||
|
||||
2. **Create Directories**:
|
||||
```bash
|
||||
sudo mkdir -p /opt/arr-stack/appdata/immich/{postgres,model-cache}
|
||||
sudo mkdir -p /mnt/unas/arr-data/immich
|
||||
sudo chown -R 1000:1000 /opt/arr-stack/appdata/immich
|
||||
sudo chown -R 1000:1000 /mnt/unas/arr-data/immich
|
||||
```
|
||||
|
||||
3. **Render Compose File**:
|
||||
```bash
|
||||
./substitute_env.sh docker-compose-files/immich/template.yaml docker-compose.immich.yml .env
|
||||
```
|
||||
|
||||
4. **Start Stack**:
|
||||
```bash
|
||||
docker compose -f docker-compose.immich.yml up -d
|
||||
```
|
||||
|
||||
## GPU Verification
|
||||
|
||||
Once the stack is running, you can verify GPU usage by the Machine Learning container:
|
||||
|
||||
```bash
|
||||
docker exec -it immich_machine_learning nvidia-smi
|
||||
```
|
||||
|
||||
You should see the RTX A400 listed. Immich will use this for facial recognition and object detection.
|
||||
87
docker-compose-files/immich/template.yaml
Normal file
87
docker-compose-files/immich/template.yaml
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
# Immich for Docker in a privileged Proxmox LXC with NVIDIA GPU support.
|
||||
# Uses the RTX A400 (Ampere) for Machine Learning and Video Transcoding.
|
||||
|
||||
services:
|
||||
immich-server:
|
||||
container_name: immich_server
|
||||
image: ghcr.io/immich-app/immich-server:{{IMMICH_VERSION:-release}}
|
||||
volumes:
|
||||
- {{IMMICH_UPLOAD_LOCATION}}:/usr/src/app/upload
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- DB_PASSWORD={{IMMICH_DB_PASSWORD}}
|
||||
- DB_USERNAME={{IMMICH_DB_USERNAME}}
|
||||
- DB_DATABASE_NAME={{IMMICH_DB_DATABASE_NAME}}
|
||||
- DB_HOSTNAME={{IMMICH_DB_HOSTNAME}}
|
||||
- REDIS_HOSTNAME={{IMMICH_REDIS_HOSTNAME}}
|
||||
- TZ={{TZ}}
|
||||
ports:
|
||||
- "2283:2283"
|
||||
depends_on:
|
||||
- redis
|
||||
- database
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:2283/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
memory: 4G
|
||||
reservations:
|
||||
memory: 1G
|
||||
|
||||
immich-machine-learning:
|
||||
container_name: immich_machine_learning
|
||||
image: ghcr.io/immich-app/immich-machine-learning:{{IMMICH_VERSION:-release}}
|
||||
runtime: nvidia
|
||||
volumes:
|
||||
- {{DOCKERCONFDIR}}/immich/model-cache:/cache
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
- NVIDIA_VISIBLE_DEVICES=all
|
||||
- NVIDIA_DRIVER_CAPABILITIES=compute,utility
|
||||
- TZ={{TZ}}
|
||||
depends_on:
|
||||
- database
|
||||
restart: always
|
||||
deploy:
|
||||
resources:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
count: 1
|
||||
capabilities: [compute, utility]
|
||||
limits:
|
||||
memory: 2G
|
||||
reservations:
|
||||
memory: 512M
|
||||
|
||||
redis:
|
||||
container_name: immich_redis
|
||||
image: docker.io/redis:6.2-alpine
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "redis-cli ping || exit 1"]
|
||||
|
||||
database:
|
||||
container_name: immich_postgres
|
||||
image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0
|
||||
environment:
|
||||
- POSTGRES_PASSWORD={{IMMICH_DB_PASSWORD}}
|
||||
- POSTGRES_USER={{IMMICH_DB_USERNAME}}
|
||||
- POSTGRES_DB={{IMMICH_DB_DATABASE_NAME}}
|
||||
- POSTGRES_INITDB_ARGS=--data-checksums
|
||||
volumes:
|
||||
- {{DOCKERCONFDIR}}/immich/postgres:/var/lib/postgresql/data
|
||||
restart: always
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -d {{IMMICH_DB_DATABASE_NAME}} -U {{IMMICH_DB_USERNAME}} || exit 1"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
|
@ -11,4 +11,5 @@ Current operational documentation:
|
|||
- [Stack installation guides](../README.md#stacks): Links to every Docker stack README.
|
||||
- [Technitium deployment](../docker-compose-files/technitium/README.md): DNS and ad-blocking service setup.
|
||||
- [Caddy deployment](../docker-compose-files/caddy/README.md): Reverse proxy with Cloudflare DNS-01.
|
||||
- [Immich deployment](../docker-compose-files/immich/README.md): Self-hosted photo management with GPU acceleration.
|
||||
- [UDM Pro SE zones and VLAN migration](network/udm-pro-zones-migration.md): Technitium-first rollout, Caddy DMZ, zone policies, DNS DNAT, and validation.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue