From e8c02a6cf3e8b66378f96fee703e94b4fc6c8ac7 Mon Sep 17 00:00:00 2001 From: msnie Date: Sat, 27 Jul 2024 23:49:10 +0200 Subject: [PATCH] immich --- immich/docker-compose.yml | 297 +++++++++++++++++++------------------- 1 file changed, 150 insertions(+), 147 deletions(-) diff --git a/immich/docker-compose.yml b/immich/docker-compose.yml index 15a4029..bd530bd 100644 --- a/immich/docker-compose.yml +++ b/immich/docker-compose.yml @@ -11,192 +11,195 @@ version: "3.8" # 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: always + + # 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: always + + # 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: always + + # 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: always + +# volumes: +# model-cache: + + 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 + container_name: immich_server + image: ghcr.io/immich-app/immich-server:latest + entrypoint: ["/bin/sh", "./start-server.sh"] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload - - /etc/localtime:/etc/localtime:ro env_file: - .env - ports: - - 2283:3001 depends_on: - redis - database + # - typesense + restart: always + + immich-microservices: + networks: + - traefik + container_name: immich_microservices + image: ghcr.io/immich-app/immich-server:latest + entrypoint: ["/bin/sh", "./start-microservices.sh"] + volumes: + - ${UPLOAD_LOCATION}:/usr/src/app/upload + env_file: + - .env + depends_on: + - redis + - database + # - typesense restart: always 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 + image: ghcr.io/immich-app/immich-machine-learning:latest volumes: + - ${UPLOAD_LOCATION}:/usr/src/app/upload - /srv/immich/model-cache:/cache env_file: - .env restart: always - redis: + immich-web: + networks: + - traefik + container_name: immich_web + image: ghcr.io/immich-app/immich-web:latest + entrypoint: ["/bin/sh", "./entrypoint.sh"] + env_file: + - .env + restart: always + 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=32400" + + # typesense: + # networks: + # - traefik + # container_name: immich_typesense + # image: typesense/typesense:0.24.0 + # environment: + # - TYPESENSE_API_KEY=${TYPESENSE_API_KEY} + # - TYPESENSE_DATA_DIR=/data + # logging: + # driver: none + # volumes: + # - /srv/immich/tsdata:/data + # restart: always + + redis: + container_name: immich_redis + image: redis:6.2 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: always database: networks: - traefik - container_name: database - image: docker.io/tensorchord/pgvecto-rs:pg14-v0.2.0@sha256:90724186f0a3517cf6914295b5ab410db9ce23190a2d9d0b9dd6463e3fa298f0 + container_name: immich_postgres + image: postgres:14 + env_file: + - .env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} - POSTGRES_INITDB_ARGS: '--data-checksums' + PG_DATA: /var/lib/postgresql/data 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"] + - /srv/immich/pgdata:/var/lib/postgresql/data restart: always -# volumes: -# model-cache: + immich-proxy: + networks: + - 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: always -# # services: -# # immich-server: -# # networks: -# # - traefik -# # container_name: immich_server -# # image: ghcr.io/immich-app/immich-server:latest -# # entrypoint: ["/bin/sh", "./start-server.sh"] -# # volumes: -# # - ${UPLOAD_LOCATION}:/usr/src/app/upload -# # env_file: -# # - .env -# # depends_on: -# # - redis -# # - database -# # - typesense -# # restart: always - -# # immich-microservices: -# # networks: -# # - traefik -# # container_name: immich_microservices -# # image: ghcr.io/immich-app/immich-server:latest -# # entrypoint: ["/bin/sh", "./start-microservices.sh"] -# # volumes: -# # - ${UPLOAD_LOCATION}:/usr/src/app/upload -# # env_file: -# # - .env -# # depends_on: -# # - redis -# # - database -# # - typesense -# # restart: always - -# # immich-machine-learning: -# # networks: -# # - traefik -# # container_name: immich_machine_learning -# # image: ghcr.io/immich-app/immich-machine-learning:latest -# # volumes: -# # - ${UPLOAD_LOCATION}:/usr/src/app/upload -# # - /srv/immich/model-cache:/cache -# # env_file: -# # - .env -# # restart: always - -# # immich-web: -# # networks: -# # - traefik -# # container_name: immich_web -# # image: ghcr.io/immich-app/immich-web:latest -# # entrypoint: ["/bin/sh", "./entrypoint.sh"] -# # env_file: -# # - .env -# # restart: always -# # 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=32400" - -# # typesense: -# # networks: -# # - traefik -# # container_name: immich_typesense -# # image: typesense/typesense:0.24.0 -# # environment: -# # - TYPESENSE_API_KEY=${TYPESENSE_API_KEY} -# # - TYPESENSE_DATA_DIR=/data -# # logging: -# # driver: none -# # volumes: -# # - /srv/immich/tsdata:/data -# # restart: always - -# # redis: -# # container_name: immich_redis -# # image: redis:6.2 -# # networks: -# # - traefik -# # restart: always - -# # database: -# # networks: -# # - traefik -# # container_name: immich_postgres -# # image: postgres:14 -# # env_file: -# # - .env -# # environment: -# # POSTGRES_PASSWORD: ${DB_PASSWORD} -# # POSTGRES_USER: ${DB_USERNAME} -# # POSTGRES_DB: ${DB_DATABASE_NAME} -# # PG_DATA: /var/lib/postgresql/data -# # volumes: -# # - /srv/immich/pgdata:/var/lib/postgresql/data -# # restart: always - -# # immich-proxy: -# # networks: -# # - 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: always +# OFFICIAL # services: