Docker service that watches a directory and uploads new images to an Immich server using immich-go.
- Create a folder
consumenext to this repo or use your own and put images there. - Provide
IMMICH_SERVERandIMMICH_API_KEYas environment variables (for docker-compose create a .env file or export them). - Start the service:
docker compose up --build -dBy default the container watches /consume (mounted from ./consume). When a new image/video is added the service runs immich-go upload from-folder <path> and deletes the file on successful upload.
IMMICH_SERVER- URL of your Immich server (e.g. http://immich.local:2283)IMMICH_API_KEY- API key for uploadsIMMICH_EXTRA_ARGS- optional extra arguments passed toimmich-go(for example--album=my-album)IMMICH_SILENT- when set to1(default) the script suppresses verbose output fromimmich-goand only prints its output when an upload fails; set to0to allowimmich-goto print normally.FAILED_DIR_NAME- Name of the directory inside the consume dir where failed uploads will be moved to. Defaults tofailed_uploadsIMMICH_ALBUM_MAP- optional mapping of subfolder -> album name. Format:folder:Album Name,other:Other Album(album names may contain spaces but must not contain commas). If provided, files placed under/consume/<folder>/...will be uploaded with--album "Album Name"unless--albumis explicitly supplied viaIMMICH_EXTRA_ARGS.
You can put environment variables in a .env file next to the docker-compose.yml so docker compose picks them up automatically. Example .env:
IMMICH_SERVER=http://immich.local:2283
IMMICH_API_KEY=your_api_key_here
IMMICH_ALBUM_MAP=vacation:Vacation 2025,work:Work PhotosBy default the repository expects a ./consume directory next to the docker-compose.yml and mounts it into the container at /consume. To change the host location, update the volume mapping in your docker-compose.yml for the service. Example:
services:
immich-consume:
build: .
restart: unless-stopped
volumes:
/path/on/host/to/consume:/consume # change this line in the docker-compose.yml file to alternate host pathIf you change the host path (left side of the :), ensure the directory exists and has appropriate permissions for the container to read/move files.
If it does not exist, it will be created with root only access rights.
- This uses inotify; files must be fully written (close/write) before upload is attempted.
immich-gois built in the image during Docker build viago install.- 100% Vibe coded and untested. Use at your own risk!