immich 설치

immich 설치

요약: Proxmox에 immich docker 설치하기

시놀로지에서 자작 나스로 가기 힘든 개인적인 이유 중 하나가 바로 시놀로지의 Photos 앱이다. Photos 앱을 대체하기 위해 사진 관련 유명한 오픈 소스 프로젝트를 여러개 사용해 봤지만, 상용 앱 대비 아쉬운 점이 한 두가지 있었다. 특히 상용 앱과 차이가 많이 난다고 느꼈던 부분은 사용성과 모바일 앱의 부족함이였다.

immich는 Google Photos의 사용성과 기능을 목표로 개발하고 있다. 아직 dev 단계이지만 평이 좋아 설치해 보았다. 그러나 개인적으로 생각하기에 아직은 실 사용하기에는 이르고, 내 사용 목적과 조금 달랐다. 이는 다음 이유로 설명할 수 있는데:

  • immich에서 과도하게 사진을 리사이즈해서인지 사진 화질이 너무 많이 떨어졌다. 아마 빠른 반응 속도를 위해 이렇게 한 것 같다.
  • 이게 가장 큰 이유인데, 시놀로지의 Photos 앱 사용 목적은 나스에 있는 사진을 보기 위한이다. immich는 조금 다른 것이, 사진을 immich에 upload해야 하고, upload 된 사진 파일은 immich의 독자적인 library에 추가된다. 추가 될 때 사진 파일 명은 hash 값으로 변경되고, hash 값으로 만들어진 디렉토리에 들어간다. 즉 immich를 사용하려면 사진 파일을 중복 저장해야 한다. 이는 클라우드에서 서비스하는 Google Photo의 모델과 동일하다.

설치 방법

immich의 docker-compose.yml를 사용하고, 설정은 가이드에 따라 .env 파일에 저장하였다. 주의할 점은 docker로 설치 시 docker image가 약 23GiB 차지하였다.

💡
아래 docker-compose.yml은 이제는 outdate 되었기에 사용하지 못한다
version: "3.8"

services:
  immich-server:
    image: altran1502/immich-server:release
    entrypoint: ["/bin/sh", "./start-server.sh"]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    depends_on:
      - redis
      - database
    restart: always

  immich-microservices:
    image: altran1502/immich-server:release
    entrypoint: ["/bin/sh", "./start-microservices.sh"]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    depends_on:
      - redis
      - database
    restart: always

  immich-machine-learning:
    image: altran1502/immich-machine-learning:release
    entrypoint: ["/bin/sh", "./entrypoint.sh"]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
    env_file:
      - .env
    environment:
      - NODE_ENV=production
    depends_on:
      - database
    restart: always

  immich-web:
    image: altran1502/immich-web:release
    entrypoint: ["/bin/sh", "./entrypoint.sh"]
    env_file:
      - .env
    restart: always

  redis:
    container_name: immich_redis
    image: redis:6.2
    restart: always
    
  database:
    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:
      - pgdata:/var/lib/postgresql/data
    restart: always

  immich-proxy:
    container_name: immich_proxy
    image: altran1502/immich-proxy:release
    ports:
      - 2283:8080
    logging:
      driver: none
    depends_on:
      - immich-server
    restart: always

volumes:
  pgdata:

.env 파일

#############################################################################
# Database
#############################################################################
DB_HOSTNAME=immich_postgres
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_DATABASE_NAME=immich

# Optional Database settings:
# DB_PORT=5432


#############################################################################
# Redis
#############################################################################
REDIS_HOSTNAME=immich_redis

# Optional Redis settings:
# REDIS_PORT=6379
# REDIS_DBINDEX=0
# REDIS_PASSWORD=
# REDIS_SOCKET=


#############################################################################
# Upload File Config
#############################################################################
UPLOAD_LOCATION=/home/ryanc/work/docker/immich/immich-data


#############################################################################
# Log message level - [simple|verbose]
#############################################################################
LOG_LEVEL=simple


#############################################################################
# JWT SECRET
#############################################################################
JWT_SECRET=setapasswordhere


#############################################################################
# MAPBOX
#############################################################################

# ENABLE_MAPBOX is either true of false -> if true, you have to provide MAPBOX_KEY
ENABLE_MAPBOX=false
MAPBOX_KEY=


#############################################################################
# WEB - Optional
#############################################################################

# Custom message on the login page, should be written in HTML form.
# For example PUBLIC_LOGIN_PAGE_MESSAGE="This is a demo instance of Immich.<br><br>Email: <i>[email protected]</i><br>Password: <i>demo</i>"

PUBLIC_LOGIN_PAGE_MESSAGE=

# For correctly display your local time zone on the web, you can set the time zone here.
# Should work fine by default value, however, in case of incorrect timezone in EXIF, this value
# should be set to the correct timezone.
# Command to get timezone:
# - Linux: curl -s http://ip-api.com/json/ | grep -oP '(?<=timezone":")(.*?)(?=")' 

TZ=Asia/Seoul