services:
  immich_redis:
    image: redis
    container_name: Immich-REDIS
    hostname: immich_redis
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: ["CMD-SHELL", "redis-cli ping || exit 1"]
    user: 1026:100
    environment:
      - TZ=America/Chicago
    volumes:
      - /volume1/docker/immich-app/redis:/data:rw
    restart: on-failure:5

  immich-db:
    image: ghcr.io/immich-app/postgres:16-vectorchord0.3.0-pgvectors0.2.0
    container_name: Immich-DB
    hostname: immich-db
    security_opt:
      - no-new-privileges:true
    env_file:
      - stack.env
    healthcheck:
      test: ["CMD", "pg_isready", "-q", "-d", "immich", "-U", "bmounteer"]
      interval: 10s
      timeout: 5s
      retries: 5
    volumes:
      - /volume1/docker/immich-app/db:/var/lib/postgresql/data:rw
    environment:
      - TZ=America/Chicago
      - POSTGRES_DB=${DB_DATABASE_NAME}
      - POSTGRES_USER=${DB_USERNAME}
      - POSTGRES_PASSWORD=${DB_PASSWORD}
      - DB_STORAGE_TYPE=HDD #Remove the red # in front of the – DB_STORAGE_TYPE=HDD if your database isn’t stored on SSDs.
    shm_size: 128mb
    restart: on-failure:5

  immich-server:
    image: ghcr.io/immich-app/immich-server:release
    container_name: Immich-SERVER
    hostname: immich-server
    user: 1026:100
    security_opt:
      - no-new-privileges:true
    env_file:
      - stack.env
    ports:
      - 8212:2283
    volumes:
      - /volume1/docker/immich-app/upload:/usr/src/app/upload:rw
      - /volume1/photo/MobileBackup/billmounteer:/usr/src/app/billmounteer:rw
      - /volume1/photo/MobileBackup/cassimounteer:/usr/src/app/cassimounteer:rw
      - /volume1/photo/Old early photos:/usr/src/app/oldEarlyPhotos:rw
      - /volume1/photo/PhotoLibrary:/usr/src/app/photoLibrary:rw
      - /volume1/photo/Google Photos:/usr/src/app/googlePhotos:rw
    restart: on-failure:5
    depends_on:
      immich_redis:
        condition: service_healthy
      immich-db:
        condition: service_started

  immich-machine-learning:
    image: ghcr.io/immich-app/immich-machine-learning:release
    container_name: Immich-LEARNING
    hostname: immich-machine-learning
    user: 1026:100
    security_opt:
      - no-new-privileges:true
    env_file:
      - stack.env
    volumes:
      - /volume1/docker/immich-app/upload:/usr/src/app/upload:rw
      - /volume1/docker/immich-app/cache:/cache:rw
      - /volume1/docker/immich-app/cache:/.cache:rw
      - /volume1/docker/immich-app/cache:/.config:rw
      - /volume1/docker/immich-app/matplotlib:/matplotlib:rw
    environment:
      - MPLCONFIGDIR=/matplotlib
    restart: on-failure:5
    depends_on:
      immich-db:
        condition: service_started

  power-tools:
    container_name: immich_power_tools
    image: ghcr.io/varun-raj/immich-power-tools:latest
    ports:
      - 8001:3000
    env_file:
      - stack.env