Salvoxia / immich-folder-album-creator

Automatically create and populate albums in Immich from a folder structure in external libraries
https://hub.docker.com/r/salvoxia/immich-folder-album-creator
222 stars 13 forks source link

Second Account #9

Closed mentex23 closed 6 months ago

mentex23 commented 6 months ago

Hello,

I have implemented the script which is working fine for my Account. I have now created an Account for my wife. How can i get this script working for different immich Account in one Docker?

Thanks

Salvoxia commented 6 months ago

Hi, at the moment, the only way is to basically run a second docker container using your wife's API key. Since the image is based on the Alpine Python base image it has a really small footprint, so I don't consider this an issue (unless you have like 50 different accounts).

If you're using docker-compose, it would look something like this:

version: "3.8"

#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#

name: immich

services:
  immich-server:
    container_name: immich_server
    volumes:
     - /path/to/my/photos:/external_libs/photos
  ...
  immich-folder-album-creator-user1:
    container_name: immich_folder_album_creator_user1
    image: salvoxia/immich-folder-album-creator:latest
    restart: unless-stopped
    environment:
      API_URL: http://immich_server:3001/api
      API_KEY: xxxxxxxxxxxxxxxxx
      ROOT_PATH: /external_libs/photos
      CRON_EXPRESSION: "0 * * * *"
      TZ: Europe/Berlin
  immich-folder-album-creator-user2:
    container_name: immich_folder_album_creator_user2
    image: salvoxia/immich-folder-album-creator:latest
    restart: unless-stopped
    environment:
      API_URL: http://immich_server:3001/api
      API_KEY: yyyyyyyyyyyyyyyyyyy
      ROOT_PATH: /external_libs/photos
      CRON_EXPRESSION: "1 * * * *"
      TZ: Europe/Berlin

It might be wise to run both containers with a slight offset in the schedule.

mentex23 commented 6 months ago

Worked!! thanks for the fast reply!