Skip to content

Commit e66b455

Browse files
committed
fix immich service
1 parent d7199e1 commit e66b455

File tree

1 file changed

+33
-54
lines changed

1 file changed

+33
-54
lines changed

templates/compose/immich.yaml

Lines changed: 33 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -4,95 +4,74 @@
44
# logo: svgs/immich.svg
55
# port: 2283
66

7-
name: immich
8-
97
services:
108
immich:
11-
container_name: immich_server
12-
image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
9+
image: ghcr.io/immich-app/immich-server:release
1310
# extends:
1411
# file: hwaccel.transcoding.yml
1512
# service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
1613
volumes:
17-
# Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
18-
- ${UPLOAD_LOCATION}:/usr/src/app/upload
14+
- immich-uploads:/usr/src/app/upload
1915
- /etc/localtime:/etc/localtime:ro
2016
environment:
2117
- SERVICE_FQDN_IMMICH_3001
22-
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables
23-
# Hardcoded values, not editable in Coolify UI
24-
- UPLOAD_LOCATION=./library # The location where your uploaded files are stored
25-
- DB_DATA_LOCATION=./postgres # The location where your database files are stored
26-
27-
- IMMICH_VERSION=${IMMICH_VERSION:-release} # The Immich version to use, editable in Coolify
28-
29-
# Default values, editable in Coolify UI
30-
- DB_PASSWORD=$SERVICE_PASSWORD_DATABASE # Default: "postgres", can be overridden
31-
- DB_USERNAME=$SERVICE_USER_DATABASE # Default: "postgres", can be overridden
32-
- DB_DATABASE_NAME=${DB_DATABASE_NAME:-immich} # Default: "immich", can be overridden
33-
18+
- UPLOAD_LOCATION=./library
19+
- DB_DATA_LOCATION=./postgres
20+
- DB_PASSWORD=$SERVICE_PASSWORD_POSTGRES
21+
- DB_USERNAME=$SERVICE_USER_POSTGRES
22+
- DB_DATABASE_NAME=${DB_DATABASE_NAME:-immich}
3423
- TZ=${TZ:-Etc/UTC}
3524
depends_on:
36-
- redis
37-
- database
38-
restart: always
25+
redis:
26+
condition: service_healthy
27+
database:
28+
condition: service_healthy
3929
healthcheck:
4030
disable: false
4131

4232
immich-machine-learning:
4333
container_name: immich_machine_learning
4434
# For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
4535
# Example tag: ${IMMICH_VERSION:-release}-cuda
46-
image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
36+
image: ghcr.io/immich-app/immich-machine-learning:release
4737
# extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
4838
# file: hwaccel.ml.yml
4939
# service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
5040
volumes:
5141
- model-cache:/cache
5242
environment:
53-
# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables
54-
55-
# Hardcoded values, not editable in Coolify UI
56-
- UPLOAD_LOCATION=./library # The location where your uploaded files are stored
57-
- DB_DATA_LOCATION=./postgres # The location where your database files are stored
58-
59-
- IMMICH_VERSION=${IMMICH_VERSION:-release} # The Immich version to use, editable in Coolify
60-
61-
# Default values, editable in Coolify UI
62-
- DB_PASSWORD=$SERVICE_PASSWORD_DATABASE # Default: "postgres", can be overridden
63-
- DB_USERNAME=$SERVICE_USER_DATABASE # Default: "postgres", can be overridden
64-
- DB_DATABASE_NAME=${DB_DATABASE_NAME:-immich} # Default: "immich", can be overridden
65-
43+
- UPLOAD_LOCATION=./library
44+
- DB_DATA_LOCATION=./postgres
45+
- DB_PASSWORD=$SERVICE_PASSWORD_POSTGRES
46+
- DB_USERNAME=$SERVICE_USER_POSTGRES
47+
- DB_DATABASE_NAME=${DB_DATABASE_NAME:-immich}
6648
- TZ=${TZ:-Etc/UTC}
6749
restart: always
6850
healthcheck:
6951
disable: false
7052

7153
redis:
72-
container_name: immich_redis
73-
image: docker.io/redis:6.2-alpine@sha256:2d1463258f2764328496376f5d965f20c6a67f66ea2b06dc42af351f75248792
54+
image: redis:7.4-alpine
7455
healthcheck:
75-
test: redis-cli ping || exit 1
76-
restart: always
56+
test:
57+
- CMD
58+
- redis-cli
59+
- PING
60+
interval: 5s
61+
timeout: 10s
62+
retries: 20
7763

7864
database:
79-
container_name: immich_postgres
8065
image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
8166
environment:
82-
POSTGRES_PASSWORD: ${DB_PASSWORD}
83-
POSTGRES_USER: ${DB_USERNAME}
84-
POSTGRES_DB: ${DB_DATABASE_NAME}
67+
POSTGRES_PASSWORD: ${SERVICE_PASSWORD_POSTGRES}
68+
POSTGRES_USER: ${SERVICE_USER_POSTGRES}
69+
POSTGRES_DB: ${DB_DATABASE_NAME:-immich}
8570
POSTGRES_INITDB_ARGS: '--data-checksums'
8671
volumes:
87-
# Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
88-
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
72+
- immich-postgres-data:/var/lib/postgresql/data
8973
healthcheck:
90-
test: pg_isready --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' || exit 1; Chksum="$$(psql --dbname='${DB_DATABASE_NAME}' --username='${DB_USERNAME}' --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
91-
interval: 5m
92-
start_interval: 30s
93-
start_period: 5m
94-
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"]
95-
restart: always
96-
97-
volumes:
98-
model-cache:
74+
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
75+
interval: 5s
76+
timeout: 20s
77+
retries: 10

0 commit comments

Comments
 (0)