version: "3.8"


services:
  immich-server:
    container_name: immich-server
    image: ghcr.io/immich-app/immich-server:release
    restart: unless-stopped
    networks:
      - shared_proxy_net
    volumes:
      - /volume1/docker/immich/library:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
    environment:
      - DB_PASSWORD=${DB_PASSWORD}        # Haalt waarde uit Portainer Env
      - DB_USERNAME=postgres
      - DB_DATABASE_NAME=immich
      - REDIS_HOSTNAME=immich-redis
      - DB_HOSTNAME=immich-postgres
      - TZ=${TZ}
      - IMMICH_SERVER_URL=http://immich-server:2283
      - IMMICH_WEB_URL=http://immich-server:2283
      - IMMICH_TRUSTED_PROXIES=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16


  immich-machine-learning:
    container_name: immich-machine-learning
    image: ghcr.io/immich-app/immich-machine-learning:release
    restart: unless-stopped
    networks:
      - shared_proxy_net
    volumes:
      - /volume1/docker/immich/model-cache:/cache
    environment:
      - TRANSFORMERS_CACHE=/cache


  immich-redis:
    container_name: immich-redis
    image: redis:6.2-alpine
    restart: unless-stopped
    networks:
      - shared_proxy_net


  immich-postgres:
    container_name: immich-postgres
    image: tensorchord/pgvecto-rs:pg14-v0.2.0
    restart: unless-stopped
    networks:
      - shared_proxy_net
    environment:
      - POSTGRES_PASSWORD=${DB_PASSWORD}  # Haalt waarde uit Portainer Env
      - POSTGRES_USER=postgres
      - POSTGRES_DB=immich
    volumes:
      - /volume1/docker/immich/postgres:/var/lib/postgresql/data


networks:
  shared_proxy_net:
    external: true