Add Immich Compose Stack

This commit is contained in:
Akumatic 2025-04-15 11:15:31 +02:00
commit 79f6d070fb
2 changed files with 127 additions and 0 deletions

9
LICENSE Normal file
View File

@ -0,0 +1,9 @@
MIT License
Copyright (c) 2025 Akumatic
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

118
docker-compose.yml Normal file
View File

@ -0,0 +1,118 @@
name: immich
services:
server:
image: ghcr.io/immich-app/immich-server:v1.131.3
container_name: immich_server
# extends:
# file: hwaccel.transcoding.yml
# service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
user: 10002:10002
depends_on:
- redis
- db
restart: unless-stopped
healthcheck:
disable: false
volumes:
- photos:/usr/src/app/upload
- /etc/localtime:/etc/localtime:ro
#ports:
#- 2283:2283
networks:
- internal
- proxy
environment:
DB_HOSTNAME: db
DB_DATABASE_NAME_FILE: /run/secrets/db_name
DB_USERNAME_FILE: /run/secrets/db_user
DB_PASSWORD_FILE: /run/secrets/db_pass
secrets:
- db_name
- db_user
- db_pass
machine-learning:
# For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
# Example tag: ${IMMICH_VERSION:-release}-cuda
image: ghcr.io/immich-app/immich-machine-learning:v1.131.3
container_name: immich_machine_learning
# extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
# file: hwaccel.ml.yml
# service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
restart: unless-stopped
healthcheck:
disable: false
volumes:
- model-cache:/cache
networks:
- internal
redis:
container_name: immich_redis
image: docker.io/redis:6.2-alpine@sha256:148bb5411c184abd288d9aaed139c98123eeb8824c5d3fce03cf721db58066d8
restart: unless-stopped
healthcheck:
test: redis-cli ping || exit 1
networks:
- internal
db:
image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:739cdd626151ff1f796dc95a6591b55a714f341c737e27f045019ceabf8e8c52
container_name: immich_db_pg14
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"
]
restart: unless-stopped
healthcheck:
test: [ CMD-SHELL,
"pg_isready -d `cat $$POSTGRES_DB_FILE` -U `cat $$POSTGRES_USER_FILE` || exit 1;",
"Chksum=$$(psql -d `cat $$POSTGRES_DB_FILE` -U `cat $$POSTGRES_USER_FILE` --tuples-only --no-align --command='SELECT COALESCE(SUM(checksum_failures), 0) FROM pg_stat_database');",
"echo 'checksum failure count is $$Chksum';",
"[[ $$Chksum = '0' ]] || exit 1"
]
interval: 5m
start_interval: 30s
start_period: 5m
volumes:
- db:/var/lib/postgresql/data
networks:
- internal
environment:
POSTGRES_DB_FILE: /run/secrets/db_name
POSTGRES_USER_FILE: /run/secrets/db_user
POSTGRES_PASSWORD_FILE: /run/secrets/db_pass
POSTGRES_INITDB_ARGS: '--data-checksums'
secrets:
- db_name
- db_user
- db_pass
volumes:
model-cache:
name: immich_model_cache
db:
name: immich_db
photos:
name: immich_photos
driver_opts:
type: "nfs"
o: "addr=data.akumatic.eu,nfsvers=4"
device: ":/mnt/data/services/photos"
networks:
internal:
name: immich-internal
proxy:
name: proxy-immich
external: true
secrets:
db_name:
file: /srv/docker/secrets/immich/db/name.txt
db_user:
file: /srv/docker/secrets/immich/db/user.txt
db_pass:
file: /srv/docker/secrets/immich/db/pass.key