networks:
  1panel-network:
    external: true

name: immich

services:
  immich-pg14-vectors:
    image: ghcr.io/immich-app/postgres:14-vectorchord0.3.0-pgvectors0.2.0
    container_name: pg14-vectors-${CONTAINER_NAME}
    labels:
      createdBy: "Apps"
    restart: always
    networks:
      - 1panel-network
    ports:
      - ${PANEL_APP_PORT_DB:-5432}:5432
    volumes:
      - ${IMMICH_ROOT_PATH}/pg14/data:/var/lib/postgresql/data
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME:-postgres}
      POSTGRES_DB: ${DB_DATABASE_NAME:-immich}
      POSTGRES_INITDB_ARGS: '--data-checksums'

  immich-server:
    depends_on:
      - immich-pg14-vectors
    image: ghcr.io/immich-app/immich-server:v1.144.1
    container_name: immich-server-${CONTAINER_NAME}
    labels:
      createdBy: "Apps"
    restart: always
    networks:
      - 1panel-network
    devices:
      - /dev/dri:/dev/dri
      # - /dev/nvidia0:/dev/nvidia0
      # - /dev/nvidiactl:/dev/nvidiactl
      # - /dev/nvidia-modeset:/dev/nvidia-modeset
      # - /dev/nvidia-nvswitchctl:/dev/nvidia-nvswitchctl
      # - /dev/nvidia-uvm:/dev/nvidia-uvm
      # - /dev/nvidia-uvm-tools:/dev/nvidia-uvm-tools
      # - /dev/video11:/dev/video11
    ports:
      - ${PANEL_APP_PORT_HTTP}:2283
    env_file:
      - ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env}
      - ${ENV_FILE:-/etc/1panel/envs/default.env}
    volumes:
      - ${IMMICH_ROOT_PATH}/data/library:/data
      - /etc/localtime:/etc/localtime
