This commit is contained in:
msnie
2025-03-12 14:32:49 +01:00
parent bfe63de0c3
commit c0a1cf3231
+316 -218
View File
@@ -1,274 +1,372 @@
version: "3.8"
# #
# WARNING: Make sure to use the docker-compose.yml of the current release: # WARNING: To install Immich, follow our guide: https://immich.app/docs/install/docker-compose
#
# Make sure to use the docker-compose.yml of the current release:
# #
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml # https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
# #
# The compose file on main may not be compatible with the latest release. # The compose file on main may not be compatible with the latest release.
#
# name: immich
# services:
# immich-server:
# container_name: immich_server
# networks:
# - traefik
# image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
# # extends:
# # file: hwaccel.transcoding.yml
# # service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
# volumes:
# - ${UPLOAD_LOCATION}:/usr/src/app/upload
# - /etc/localtime:/etc/localtime:ro
# env_file:
# - .env
# ports:
# - 2283:3001
# depends_on:
# - redis
# - database
# restart: unless-stopped
# immich-machine-learning:
# networks:
# - traefik
# container_name: immich_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:${IMMICH_VERSION:-release}
# # 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
# volumes:
# - /srv/immich/model-cache:/cache
# env_file:
# - .env
# restart: unless-stopped
# redis:
# networks:
# - traefik
# container_name: redis
# image: redis:latest
# command: ["redis-server", "--bind", "redis", "--port", "6379"]
# # image: docker.io/redis:6.2-alpine@sha256:e3b17ba9479deec4b7d1eeec1548a253acc5374d68d3b27937fcfe4df8d18c7e
# # healthcheck:
# # test: redis-cli ping || exit 1
# restart: unless-stopped
# database:
# networks:
# - traefik
# container_name: database
# image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
# environment:
# POSTGRES_PASSWORD: ${DB_PASSWORD}
# POSTGRES_USER: ${DB_USERNAME}
# POSTGRES_DB: ${DB_DATABASE_NAME}
# POSTGRES_INITDB_ARGS: '--data-checksums'
# volumes:
# - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
# # healthcheck:
# # 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
# # interval: 5m
# # start_interval: 30s
# # start_period: 5m
# 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
# volumes:
# model-cache:
name: immich
services: services:
immich-server: immich-server:
networks:
- traefik
container_name: immich_server container_name: immich_server
image: ghcr.io/immich-app/immich-server:release image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
entrypoint: ["/bin/sh", "./start-server.sh"] # extends:
# file: hwaccel.transcoding.yml
# service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
volumes: volumes:
# 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
- ${UPLOAD_LOCATION}:/usr/src/app/upload - ${UPLOAD_LOCATION}:/usr/src/app/upload
- /etc/localtime:/etc/localtime:ro
env_file: env_file:
- .env - .env
ports:
- '2283:2283'
depends_on: depends_on:
- redis - redis
- database - database
# - typesense restart: always
restart: unless-stopped healthcheck:
disable: false
immich-microservices:
networks:
- traefik
container_name: immich_microservices
image: ghcr.io/immich-app/immich-server:release
entrypoint: ["/bin/sh", "./start-microservices.sh"]
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
env_file:
- .env
depends_on:
- redis
- database
# - typesense
restart: unless-stopped
immich-machine-learning:
networks:
- traefik
container_name: immich_machine_learning
image: ghcr.io/immich-app/immich-machine-learning:release
volumes:
- ${UPLOAD_LOCATION}:/usr/src/app/upload
- /srv/immich/model-cache:/cache
env_file:
- .env
restart: unless-stopped
immich-web:
networks:
- traefik
container_name: immich_web
image: ghcr.io/immich-app/immich-web:release
entrypoint: ["/bin/sh", "./entrypoint.sh"]
env_file:
- .env
restart: unless-stopped
labels: labels:
- traefik.enable=true - traefik.enable=true
- "traefik.http.routers.imm.entrypoints=websecure" - "traefik.http.routers.imm.entrypoints=websecure"
- "traefik.http.routers.imm.rule=Host(`imm.knast.cc`)" - "traefik.http.routers.imm.rule=Host(`imm.knast.cc`)"
- "traefik.http.routers.imm.tls.certresolver=letsencr" - "traefik.http.routers.imm.tls.certresolver=letsencr"
# - "traefik.http.services.imm.loadbalancer.server.port=32400"
# typesense: immich-machine-learning:
# networks: container_name: immich_machine_learning
# - traefik # For hardware acceleration, add one of -[armnn, cuda, openvino] to the image tag.
# container_name: immich_typesense # Example tag: ${IMMICH_VERSION:-release}-cuda
# image: typesense/typesense:0.24.0 image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
# environment: # extends: # uncomment this section for hardware acceleration - see https://immich.app/docs/features/ml-hardware-acceleration
# - TYPESENSE_API_KEY=${TYPESENSE_API_KEY} # file: hwaccel.ml.yml
# - TYPESENSE_DATA_DIR=/data # service: cpu # set to one of [armnn, cuda, openvino, openvino-wsl] for accelerated inference - use the `-wsl` version for WSL2 where applicable
# logging: volumes:
# driver: none - model-cache:/cache
# volumes: env_file:
# - /srv/immich/tsdata:/data - .env
# restart: unless-stopped restart: always
healthcheck:
disable: false
redis: redis:
container_name: immich_redis container_name: immich_redis
image: redis:6.2 image: docker.io/redis:6.2-alpine@sha256:148bb5411c184abd288d9aaed139c98123eeb8824c5d3fce03cf721db58066d8
networks: healthcheck:
- traefik test: redis-cli ping || exit 1
restart: unless-stopped restart: always
database: database:
networks:
- traefik
container_name: immich_postgres container_name: immich_postgres
image: postgres:14 image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:739cdd626151ff1f796dc95a6591b55a714f341c737e27f045019ceabf8e8c52
env_file:
- .env
environment: environment:
POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_USER: ${DB_USERNAME} POSTGRES_USER: ${DB_USERNAME}
POSTGRES_DB: ${DB_DATABASE_NAME} POSTGRES_DB: ${DB_DATABASE_NAME}
PG_DATA: /var/lib/postgresql/data POSTGRES_INITDB_ARGS: '--data-checksums'
volumes: volumes:
- /srv/immich/pgdata:/var/lib/postgresql/data # 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
restart: unless-stopped - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
healthcheck:
test: >-
pg_isready --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" || exit 1;
Chksum="$$(psql --dbname="$${POSTGRES_DB}" --username="$${POSTGRES_USER}" --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
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: always
immich-proxy: volumes:
networks: model-cache:
- traefik
container_name: immich_proxy
image: ghcr.io/immich-app/immich-proxy:release
environment:
# Make sure these values get passed through from the env file
- IMMICH_SERVER_URL
- IMMICH_WEB_URL
ports:
- 2283:8080
logging:
driver: none
depends_on:
- immich-server
restart: unless-stopped
# OFFICIAL
# version: "3.8"
# #
# # WARNING: Make sure to use the docker-compose.yml of the current release:
# #
# # https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
# #
# # The compose file on main may not be compatible with the latest release.
# #
# # name: immich
# # services:
# # immich-server:
# # container_name: immich_server
# # networks:
# # - traefik
# # image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
# # # extends:
# # # file: hwaccel.transcoding.yml
# # # service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
# # volumes:
# # - ${UPLOAD_LOCATION}:/usr/src/app/upload
# # - /etc/localtime:/etc/localtime:ro
# # env_file:
# # - .env
# # ports:
# # - 2283:3001
# # depends_on:
# # - redis
# # - database
# # restart: unless-stopped
# # immich-machine-learning:
# # networks:
# # - traefik
# # container_name: immich_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:${IMMICH_VERSION:-release}
# # # 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
# # volumes:
# # - /srv/immich/model-cache:/cache
# # env_file:
# # - .env
# # restart: unless-stopped
# # redis:
# # networks:
# # - traefik
# # container_name: redis
# # image: redis:latest
# # command: ["redis-server", "--bind", "redis", "--port", "6379"]
# # # image: docker.io/redis:6.2-alpine@sha256:e3b17ba9479deec4b7d1eeec1548a253acc5374d68d3b27937fcfe4df8d18c7e
# # # healthcheck:
# # # test: redis-cli ping || exit 1
# # restart: unless-stopped
# # database:
# # networks:
# # - traefik
# # container_name: database
# # image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0
# # environment:
# # POSTGRES_PASSWORD: ${DB_PASSWORD}
# # POSTGRES_USER: ${DB_USERNAME}
# # POSTGRES_DB: ${DB_DATABASE_NAME}
# # POSTGRES_INITDB_ARGS: '--data-checksums'
# # volumes:
# # - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
# # # healthcheck:
# # # 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
# # # interval: 5m
# # # start_interval: 30s
# # # start_period: 5m
# # 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
# # volumes:
# # model-cache:
# services: # services:
# immich: # immich-server:
# image: ghcr.io/imagegenius/immich:latest
# container_name: immich
# networks: # networks:
# - traefik # - traefik
# container_name: immich_server
# image: ghcr.io/immich-app/immich-server:release
# entrypoint: ["/bin/sh", "./start-server.sh"]
# volumes:
# - ${UPLOAD_LOCATION}:/usr/src/app/upload
# env_file:
# - .env
# depends_on:
# - redis
# - database
# # - typesense
# restart: unless-stopped
# immich-microservices:
# networks:
# - traefik
# container_name: immich_microservices
# image: ghcr.io/immich-app/immich-server:release
# entrypoint: ["/bin/sh", "./start-microservices.sh"]
# volumes:
# - ${UPLOAD_LOCATION}:/usr/src/app/upload
# env_file:
# - .env
# depends_on:
# - redis
# - database
# # - typesense
# restart: unless-stopped
# immich-machine-learning:
# networks:
# - traefik
# container_name: immich_machine_learning
# image: ghcr.io/immich-app/immich-machine-learning:release
# volumes:
# - ${UPLOAD_LOCATION}:/usr/src/app/upload
# - /srv/immich/model-cache:/cache
# env_file:
# - .env
# restart: unless-stopped
# immich-web:
# networks:
# - traefik
# container_name: immich_web
# image: ghcr.io/immich-app/immich-web:release
# entrypoint: ["/bin/sh", "./entrypoint.sh"]
# env_file:
# - .env
# restart: unless-stopped
# labels: # labels:
# - traefik.enable=true # - traefik.enable=true
# - "traefik.http.routers.imm.entrypoints=websecure" # - "traefik.http.routers.imm.entrypoints=websecure"
# - "traefik.http.routers.imm.rule=Host(`imm.$DOMAIN_NAME`)" # - "traefik.http.routers.imm.rule=Host(`imm.knast.cc`)"
# - "traefik.http.routers.imm.tls.certresolver=letsencr" # - "traefik.http.routers.imm.tls.certresolver=letsencr"
# - "traefik.http.services.imm.loadbalancer.server.port=7878" # # - "traefik.http.services.imm.loadbalancer.server.port=32400"
# environment:
# - PUID=1000 # # typesense:
# - PGID=1000 # # networks:
# - TZ=Etc/UTC # # - traefik
# - DB_HOSTNAME=database # # container_name: immich_typesense
# - DB_USERNAME=postgres # # image: typesense/typesense:0.24.0
# - DB_PASSWORD=a897scf-ac8c3aghjfghafwfgr44k-567cvhdf3odjkfg # # environment:
# - DB_DATABASE_NAME=immich # # - TYPESENSE_API_KEY=${TYPESENSE_API_KEY}
# - REDIS_HOSTNAME=redis # # - TYPESENSE_DATA_DIR=/data
# # - DB_PORT=5432 #optional # # logging:
# # - REDIS_PORT=6379 #optional # # driver: none
# # - REDIS_PASSWORD= #optional # # volumes:
# # - MACHINE_LEARNING_HOST=0.0.0.0 #optional # # - /srv/immich/tsdata:/data
# # - MACHINE_LEARNING_PORT=3003 #optional # # restart: unless-stopped
# # - MACHINE_LEARNING_WORKERS=1 #optional
# # - MACHINE_LEARNING_WORKER_TIMEOUT=120 #optional # redis:
# volumes: # container_name: immich_redis
# - /srv/immich/config:/config # image: redis:6.2
# - /srv/immich/uploads:/photos # networks:
# # - path_to_libraries:/libraries #optional # - traefik
# ports:
# - 7878:8080
# restart: unless-stopped # restart: unless-stopped
# # This container requires an external application to be run separately.
# # By default, ports for the databases are opened, be careful when deploying it
# # Redis:
# redis:
# networks:
# - traefik
# image: redis
# ports:
# - 6379:6379
# container_name: redis
# # PostgreSQL 14:
# database: # database:
# image: tensorchord/pgvecto-rs:pg14-v0.2.0
# ports:
# - 5432:5432
# container_name: database
# networks: # networks:
# - traefik # - traefik
# container_name: immich_postgres
# image: postgres:14
# env_file:
# - .env
# environment: # environment:
# POSTGRES_USER: postgres # POSTGRES_PASSWORD: ${DB_PASSWORD}
# POSTGRES_PASSWORD: a897scf-ac8c3aghjfghafwfgr44k-567cvhdf3odjkfg # POSTGRES_USER: ${DB_USERNAME}
# POSTGRES_DB: immich # POSTGRES_DB: ${DB_DATABASE_NAME}
# PG_DATA: /var/lib/postgresql/data
# volumes: # volumes:
# - /srv/immich/pgdata:/var/lib/postgresql/data # - /srv/immich/pgdata:/var/lib/postgresql/data
# restart: unless-stopped
# # volumes: # immich-proxy:
# # pgdata: # networks:
# # model-cache: # - traefik
# # tsdata: # container_name: immich_proxy
# image: ghcr.io/immich-app/immich-proxy:release
# environment:
# # Make sure these values get passed through from the env file
# - IMMICH_SERVER_URL
# - IMMICH_WEB_URL
# ports:
# - 2283:8080
# logging:
# driver: none
# depends_on:
# - immich-server
# restart: unless-stopped
networks:
traefik: # # OFFICIAL
external: true
# # services:
# # immich:
# # image: ghcr.io/imagegenius/immich:latest
# # container_name: immich
# # networks:
# # - traefik
# # labels:
# # - traefik.enable=true
# # - "traefik.http.routers.imm.entrypoints=websecure"
# # - "traefik.http.routers.imm.rule=Host(`imm.$DOMAIN_NAME`)"
# # - "traefik.http.routers.imm.tls.certresolver=letsencr"
# # - "traefik.http.services.imm.loadbalancer.server.port=7878"
# # environment:
# # - PUID=1000
# # - PGID=1000
# # - TZ=Etc/UTC
# # - DB_HOSTNAME=database
# # - DB_USERNAME=postgres
# # - DB_PASSWORD=a897scf-ac8c3aghjfghafwfgr44k-567cvhdf3odjkfg
# # - DB_DATABASE_NAME=immich
# # - REDIS_HOSTNAME=redis
# # # - DB_PORT=5432 #optional
# # # - REDIS_PORT=6379 #optional
# # # - REDIS_PASSWORD= #optional
# # # - MACHINE_LEARNING_HOST=0.0.0.0 #optional
# # # - MACHINE_LEARNING_PORT=3003 #optional
# # # - MACHINE_LEARNING_WORKERS=1 #optional
# # # - MACHINE_LEARNING_WORKER_TIMEOUT=120 #optional
# # volumes:
# # - /srv/immich/config:/config
# # - /srv/immich/uploads:/photos
# # # - path_to_libraries:/libraries #optional
# # ports:
# # - 7878:8080
# # restart: unless-stopped
# # # This container requires an external application to be run separately.
# # # By default, ports for the databases are opened, be careful when deploying it
# # # Redis:
# # redis:
# # networks:
# # - traefik
# # image: redis
# # ports:
# # - 6379:6379
# # container_name: redis
# # # PostgreSQL 14:
# # database:
# # image: tensorchord/pgvecto-rs:pg14-v0.2.0
# # ports:
# # - 5432:5432
# # container_name: database
# # networks:
# # - traefik
# # environment:
# # POSTGRES_USER: postgres
# # POSTGRES_PASSWORD: a897scf-ac8c3aghjfghafwfgr44k-567cvhdf3odjkfg
# # POSTGRES_DB: immich
# # volumes:
# # - /srv/immich/pgdata:/var/lib/postgresql/data
# # # volumes:
# # # pgdata:
# # # model-cache:
# # # tsdata:
# networks:
# traefik:
# external: true