name: immich
networks:
  1panel-network:
    external: true
services:
  immich-pg14-vectors:
    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
    container_name: pg14-vectors-immich-no-machine
    environment:
      POSTGRES_DB: ${DB_DATABASE_NAME:-immich}
      POSTGRES_INITDB_ARGS: --data-checksums
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME:-postgres}
    healthcheck:
      interval: 5m
      start_interval: 30s
      start_period: 5m
      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
    image: tensorchord/pgvecto-rs:pg14-v0.2.0
    labels:
      createdBy: Apps
    networks:
    - 1panel-network
    ports:
    - ${PANEL_APP_PORT_DB:-5432}:5432
    restart: always
    volumes:
    - ${IMMICH_ROOT_PATH}/pg14/data:/var/lib/postgresql/data
  immich-server:
    container_name: immich-server-immich-no-machine
    depends_on:
    - immich-pg14-vectors
    devices:
    - /dev/dri:/dev/dri
    env_file:
    - ./envs/global.env
    - .env
    healthcheck:
      disable: false
    image: ghcr.io/immich-app/immich-server:v1.123.0
    labels:
      createdBy: Apps
    networks:
    - 1panel-network
    ports:
    - ${PANEL_APP_PORT_HTTP}:2283
    restart: always
    volumes:
    - ${IMMICH_ROOT_PATH}/data/library:/usr/src/app/upload
    - /etc/localtime:/etc/localtime
