Update immich version and improve workers

Add new worker role for dedicated workers and add limits to defaults workers
This commit is contained in:
Tobias Reisinger 2025-11-12 00:44:22 +01:00
parent 92e16eea34
commit 92ed74d591
Signed by: serguzim
GPG key ID: 13AD60C237A28DFE
4 changed files with 101 additions and 8 deletions

View file

@ -4,20 +4,14 @@ immich_db_db: immich
immich_db_user: "{{ vault_immich.db.user }}" immich_db_user: "{{ vault_immich.db.user }}"
immich_db_pass: "{{ vault_immich.db.pass }}" immich_db_pass: "{{ vault_immich.db.pass }}"
immich_docker_tag: v1.137.0 immich_docker_tag: v2.2.3
immich_svc: immich_svc:
domain: "{{ all_services | service_get_domain(role_name) }}" domain: "{{ all_services | service_get_domain(role_name) }}"
port: 2283 port: 2283
version: release
db:
host: "{{ postgres.host }}"
database: authentik
immich_env: immich_env:
# IMMICH_CONFIG_FILE: /immich.json
TZ: "{{ timezone }}" TZ: "{{ timezone }}"
DB_HOSTNAME: "{{ immich_db_host }}" DB_HOSTNAME: "{{ immich_db_host }}"
@ -40,14 +34,38 @@ immich_compose:
file: file:
services: services:
app: app:
environment:
IMMICH_WORKERS_INCLUDE: api
depends_on: depends_on:
- database - database
- redis - redis
worker:
image: ghcr.io/immich-app/immich-server:{{ immich_docker_tag }}
labels:
net.serguzim.logs.collect: true
env_file:
- .env
environment:
IMMICH_WORKERS_EXCLUDE: api
cpus: 1.0
mem_limit: 1g
volumes:
- upload:/usr/src/app/upload
restart: always
networks:
default:
depends_on:
- app
- database
- redis
machine-learning: machine-learning:
image: ghcr.io/immich-app/immich-machine-learning:{{ immich_docker_tag }} image: ghcr.io/immich-app/immich-machine-learning:{{ immich_docker_tag }}
labels: labels:
net.serguzim.logs.collect: true net.serguzim.logs.collect: true
cpus: 1.0
mem_limit: 1g
volumes: volumes:
- model-cache:/cache - model-cache:/cache
env_file: env_file:
@ -59,6 +77,8 @@ immich_compose:
redis: redis:
image: redis:6.2-alpine image: redis:6.2-alpine
restart: always restart: always
ports:
- "{{ host_vpn_ip }}:2284:6379"
networks: networks:
default: default:
@ -71,6 +91,8 @@ immich_compose:
volumes: volumes:
- pgdata:/var/lib/postgresql/data - pgdata:/var/lib/postgresql/data
restart: always restart: always
ports:
- "{{ host_vpn_ip }}:2285:5432"
networks: networks:
default: default:

View file

@ -0,0 +1,51 @@
---
immich_worker_db_host: "{{ }}"
immich_worker_db_db: immich
immich_worker_db_user: "{{ vault_immich.db.user }}"
immich_worker_db_pass: "{{ vault_immich.db.pass }}"
immich_worker_docker_tag: v2.2.3
immich_worker_env:
# IMMICH_CONFIG_FILE: /immich.json
TZ: "{{ timezone }}"
IMMICH_WORKERS_EXCLUDE: api
DB_HOSTNAME: "{{ hostvars['node001'].host_vpn_ip }}"
DB_PORT: 2285
DB_DATABASE_NAME: "{{ immich_worker_db_db }}"
DB_USERNAME: "{{ immich_worker_db_user }}"
DB_PASSWORD: "{{ immich_worker_db_pass }}"
POSTGRES_DB: "{{ immich_worker_db_db }}"
POSTGRES_USER: "{{ immich_worker_db_user }}"
POSTGRES_PASSWORD: "{{ immich_worker_db_pass }}"
REDIS_HOSTNAME: "{{ hostvars['node001'].host_vpn_ip }}"
REDIS_PORT: 2284
immich_worker_compose:
collect_logs: true
watchtower: monitor
image: ghcr.io/immich-app/immich-server:{{ immich_worker_docker_tag }}
volumes:
- upload:/usr/src/app/upload
file:
services:
machine-learning:
image: ghcr.io/immich-app/immich-machine-learning:{{ immich_worker_docker_tag }}
labels:
net.serguzim.logs.collect: true
volumes:
- model-cache:/cache
env_file:
- .env
restart: always
networks:
default:
volumes:
upload: "{{ vault_immich.upload_volume_driver }}"
pgdata:
model-cache:

View file

@ -0,0 +1,11 @@
---
- name: Set common facts
ansible.builtin.import_tasks: tasks/set-default-facts.yml
- name: Deploy {{ role_name }}
vars:
env: "{{ immich_worker_env }}"
compose: "{{ immich_worker_compose }}"
block:
- name: Import tasks to deploy common service
ansible.builtin.import_tasks: tasks/deploy-common-service.yml

View file

@ -294,11 +294,20 @@ services = {
monitoring = { monitoring = {
group = "3-services" group = "3-services"
} }
auth = true auth = false
auth_redirects = ["https://gallery.serguzim.me/auth/login"] auth_redirects = ["https://gallery.serguzim.me/auth/login"]
database = false database = false
}, },
"immich_worker" = {
host = "node004"
monitoring = {
group = "7-support"
}
auth = false
database = false
},
"influxdb" = { "influxdb" = {
host = "node001" host = "node001"
dns = [{ dns = [{