homelab-blueprint/docker-compose-files/immich/template.yaml
2026-06-17 22:15:54 +02:00

97 lines
3 KiB
YAML

# 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
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}}
# OIDC (optional - leave disabled unless explicitly configured)
- OAUTH_ENABLED={{OIDC_ENABLED:-false}}
- OAUTH_ISSUER_URL={{OIDC_ISSUER:-}}
- OAUTH_CLIENT_ID={{OIDC_CLIENT_ID:-}}
- OAUTH_CLIENT_SECRET={{OIDC_CLIENT_SECRET:-}}
- OAUTH_BUTTON_TEXT={{OIDC_NAME:-}}
- OAUTH_AUTO_LAUNCH={{OIDC_AUTO_REDIRECT:-}}
- OAUTH_MOBILE_OVERRIDE_ENABLED={{OIDC_MOBILE_OVERRIDE_ENABLED:-false}}
# Email (optional - leave blank to disable)
- SMTP_HOST={{EMAIL_HOST:-}}
- SMTP_PORT={{EMAIL_PORT:-}}
- SMTP_USERNAME={{EMAIL_HOST_USER:-}}
- SMTP_PASSWORD={{EMAIL_HOST_PASSWORD:-}}
- SMTP_FROM={{DEFAULT_FROM_EMAIL:-}}
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
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