Tag Archives: docker

Complete config Immich/Powertools and Kiosk

For ML i’m using a second machine with GPU.

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.transcoding.yml
    #   service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
    volumes:
      # Do not edit the next line. If you want to change the media storage location on your system, edit the value of UPLOAD_LOCATION in the .env file
      - ${UPLOAD_LOCATION}:/data
      - /etc/localtime:/etc/localtime:ro
    env_file:
      - .env
    ports:
      - '2283:2283'
    depends_on:
      - redis
      - database
    restart: always
    healthcheck:
      disable: false

  immich-machine-learning:
    container_name: immich_machine_learning
    # For hardware acceleration, add one of -[armnn, cuda, rocm, openvino, rknn] to the image tag.
    # Example tag: ${IMMICH_VERSION:-release}-cuda
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    # extends: # uncomment this section for hardware acceleration - see https://docs.immich.app/features/ml-hardware-acceleration
    #   file: hwaccel.ml.yml
    #   service: cpu # set to one of [armnn, cuda, rocm, openvino, openvino-wsl, rknn] for accelerated inference - use the `-wsl` version for WSL2 where applicable
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: always
    healthcheck:
      disable: false

  immich-kiosk:
    image: ghcr.io/damongolding/immich-kiosk:latest
    container_name: immich-kiosk
    environment:
        LANG: "en_GB"
        TZ: "Europe/Amsterdam"
        # Required settings
        KIOSK_IMMICH_API_KEY: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXx"
        KIOSK_IMMICH_URL: "https://mypix.henriaanstoot.nl/"
        # External url for image links/QR codes
        KIOSK_IMMICH_EXTERNAL_URL: ""
        # Clock
        KIOSK_SHOW_TIME: true
        KIOSK_TIME_FORMAT: 24
        KIOSK_SHOW_DATE: false
        KIOSK_DATE_FORMAT: YYYY/MM/DD
        KIOSK_CLOCK_SOURCE: client
        # Kiosk behaviour
        KIOSK_DURATION: 60
        KIOSK_DISABLE_SCREENSAVER: false
        KIOSK_OPTIMIZE_IMAGES: false
        KIOSK_USE_GPU: true
        KIOSK_BURN_IN_INTERVAL: 0
        KIOSK_BURN_IN_DURATION: 30
        KIOSK_BURN_IN_OPACITY: 70
        # Asset sources
        KIOSK_SHOW_ARCHIVED: false
        KIOSK_ALBUMS: ""
        KIOSK_ALBUM_ORDER: random
        KIOSK_EXCLUDED_ALBUMS: "ALBUM_ID,ALBUM_ID,ALBUM_ID"
        KIOSK_PEOPLE: ""
        KIOSK_REQUIRE_ALL_PEOPLE: false
        KIOSK_EXCLUDED_PEOPLE: "PERSON_ID,PERSON_ID,PERSON_ID"
        KIOSK_DATES: ""
        KIOSK_TAGS: ""
        KIOSK_EXCLUDED_TAGS: "TAG_VALUE,TAG_VALUE,TAG_VALUE"
        KIOSK_RATING: -1
        KIOSK_EXCLUDED_PARTNERS: "PARTNER_ID"
        KIOSK_MEMORIES: false
        KIOSK_BLACKLIST: "ASSET_ID,ASSET_ID,ASSET_ID"
        # FILTER
        KIOSK_FILTER_DATE: ""
        KIOSK_FILTER_NEWEST: 0
        KIOSK_FILTER_EXCLUDE_FACES: false
        KIOSK_FILTER_FAVORITES: false
        # UI
        KIOSK_SHOW_PROGRESS_BAR: false
        KIOSK_DISABLE_NAVIGATION: false
        KIOSK_DISABLE_UI: false
        KIOSK_FRAMELESS: false
        KIOSK_HIDE_CURSOR: false
        KIOSK_FONT_SIZE: 100
        KIOSK_BACKGROUND_BLUR: true
        KIOSK_BACKGROUND_BLUR_AMOUNT: 10
        KIOSK_THEME: fade
        KIOSK_LAYOUT: single
        KIOSK_SHOW_USER: false
        # Sleep mode
        # KIOSK_SLEEP_START: 22
        # KIOSK_SLEEP_END: 7
        # KIOSK_SLEEP_DIM_SCREEN: false
        # Transistion options
        KIOSK_TRANSITION: none
        KIOSK_FADE_TRANSITION_DURATION: 1
        KIOSK_CROSS_FADE_TRANSITION_DURATION: 1
        # Image display settings
        KIOSK_IMAGE_FIT: contain
        KIOSK_IMAGE_EFFECT: zoom
        KIOSK_IMAGE_EFFECT_AMOUNT: 120
        KIOSK_USE_ORIGINAL_IMAGE: false
        # Video
        KIOSK_SHOW_VIDEOS: true
        KIOSK_LIVE_PHOTOS: false
        KIOSK_LIVE_PHOTO_LOOP_DELAY: 0
        KIOSK_SHOW_ANIMATED_GIFS: false
        # Image metadata
        KIOSK_SHOW_IMAGE_RATING: true
        KIOSK_SHOW_OWNER: false
        KIOSK_SHOW_ALBUM_NAME: true
        KIOSK_SHOW_PERSON_NAME: false
        KIOSK_SHOW_PERSON_AGE: false
        KIOSK_SHOW_IMAGE_TIME: true
        KIOSK_IMAGE_TIME_FORMAT: 24
        KIOSK_SHOW_IMAGE_DATE: true
        KIOSK_IMAGE_DATE_FORMAT: YYYY-MM-DD
        KIOSK_SHOW_IMAGE_DESCRIPTION: true
        KIOSK_SHOW_IMAGE_CAMERA: false
        KIOSK_SHOW_IMAGE_EXIF: true
        KIOSK_SHOW_IMAGE_LOCATION: true
        KIOSK_HIDE_COUNTRIES: "HIDDEN_COUNTRY,HIDDEN_COUNTRY"
        KIOSK_SHOW_IMAGE_ID: false
        KIOSK_SHOW_IMAGE_QR: false
        KIOSK_SHOW_MORE_INFO: true
        KIOSK_SHOW_MORE_INFO_IMAGE_LINK: true
        KIOSK_SHOW_MORE_INFO_QR_CODE: true
        # More info actions
        KIOSK_LIKE_BUTTON_ACTION: favorite
        KIOSK_HIDE_BUTTON_ACTION: tag
        # Kiosk settings
        KIOSK_PORT: 3000
        KIOSK_BEHIND_PROXY: false
        KIOSK_DISABLE_URL_QUERIES: false
        KIOSK_DISABLE_CONFIG_ENDPOINT: false
        KIOSK_ENABLE_URL_BUILDER: false
        KIOSK_WATCH_CONFIG: false
        KIOSK_FETCHED_ASSETS_SIZE: 1000
        KIOSK_HTTP_TIMEOUT: 20
        KIOSK_PASSWORD: ""
        KIOSK_CACHE: true
        KIOSK_PREFETCH: true
        KIOSK_ASSET_WEIGHTING: true
    ports:
      - 3000:3000
    restart: always
    healthcheck:
      test: ["CMD", "/kiosk", "--healthcheck"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 10s


  redis:
    container_name: immich_redis
    image: docker.io/valkey/valkey:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    healthcheck:
      test: redis-cli ping || exit 1
    restart: always

  database:
    container_name: immich_postgres
    image: ghcr.io/immich-app/postgres:14-vectorchord0.4.3-pgvectors0.2.0xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
      POSTGRES_INITDB_ARGS: '--data-checksums'
      # Uncomment the DB_STORAGE_TYPE: 'HDD' var if your database isn't stored on SSDs
      # DB_STORAGE_TYPE: 'HDD'
    volumes:
      # Do not edit the next line. If you want to change the database storage location on your system, edit the value of DB_DATA_LOCATION in the .env file
      - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
    shm_size: 128mb
    restart: always
  power-tools:
    container_name: immich_power_tools
    image: ghcr.io/immich-power-tools/immich-power-tools:latest
    volumes:
      - immich-power-tools-data:/app/data
    ports:
      - "8001:3000"
    env_file:
      - .env
    healthcheck:
      test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s

volumes:
  model-cache:
  immich-power-tools-data:

Immich and (not) Google Timeline

Google killed timeline.

I’ve been experimenting in the past with GPS (gpx) mappers and alternatives.

Now I’ve installed Dawarich, which can use the photos in my immich library.

https://dawarich.app

Spin up a docker instance, create an API key in immich, and GO.

I’ve imported google’s timeline.json from my phone.

Auto post locations to your instance API using:

Testing software for a paperless office.

I always wanted to have everything on my fileserver. But indexing or searching for the right document is a pain in the *ss.

I wrote several tools for this but wanted to try something new.

Maybe its a perfect solution for all my datasheets I use in my electronics as well.

So I installed Paperless-ngx using docker.

Paperless-ngx is a community-supported open-source document management system that transforms your physical documents into a searchable online archive so you can keep, well, less paper.

Features

  • Organize and index your scanned documents with tags, correspondents, types, and more.
  • Your data is stored locally on your server and is never transmitted or shared in any way.
  • Performs OCR on your documents, adding searchable and selectable text, even to documents scanned with only images.
  • Utilizes the open-source Tesseract engine to recognize more than 100 languages.
  • Documents are saved as PDF/A format which is designed for long term storage, alongside the unaltered originals.
  • Uses machine-learning to automatically add tags, correspondents and document types to your documents.
  • Supports PDF documents, images, plain text files, Office documents (Word, Excel, PowerPoint, and LibreOffice equivalents) and more.
  • Paperless stores your documents plain on disk. Filenames and folders are managed by paperless and their format can be configured freely with different configurations assigned to different documents.
  • Beautiful, modern web application that features:
    • Customizable dashboard with statistics.
    • Filtering by tags, correspondents, types, and more.
    • Bulk editing of tags, correspondents, types and more.
    • Drag-and-drop uploading of documents throughout the app.
    • Customizable views can be saved and displayed on the dashboard and / or sidebar.
    • Support for custom fields of various data types.
    • Shareable public links with optional expiration.
  • Full text search helps you find what you need:
    • Auto completion suggests relevant words from your documents.
    • Results are sorted by relevance to your search query.
    • Highlighting shows you which parts of the document matched the query.
    • Searching for similar documents (“More like this”)
  • Email processing: import documents from your email accounts:
    • Configure multiple accounts and rules for each account.
    • After processing, paperless can perform actions on the messages such as marking as read, deleting and more.
  • A built-in robust multi-user permissions system that supports ‘global’ permissions as well as per document or object.
  • A powerful workflow system that gives you even more control.
  • Optimized for multi core systems: Paperless-ngx consumes multiple documents in parallel.
  • The integrated sanity checker makes sure that your document archive is in good health.

I’ll keep adding to this page at a later time

Playing with my private search engine

Searx is a free and open-source metasearch engine, available under the GNU Affero General Public License version 3, with the aim of protecting the privacy of its users. To this end, Searx does not share users’ IP addresses or search history with the search engines from which it gathers results.

It’s easy to install using docker, but i wanted to add my own mysql server data. ( pipetune search engine data in below example )
There are many search plugins and quite hackable.
But there was a missing python module in a docker image.

ModuleNotFoundError: No module named ‘mysql’

So i build a new docker image based on the original

# Install docker and docker-compose

cd /usr/local
git clone https://github.com/searxng/searxng-docker.git
cd searxng-docker
Edit the .env file to set the hostname 
Generate the secret key sed -i "s|ultrasecretkey|$(openssl rand -hex 32)|g" searxng/settings.yml
Edit the searxng/settings.yml file according to your need
Check everything is working: docker-compose up
Run SearXNG in the background: docker-compose up -d

I’ve changed the docker-compose.yaml

Changed
<     image: searxng/searxng:latest

into 
>     build: .

And
changed the listen address
<      - "127.0.0.1:8080:8080"
into
>      - "8080:8080"

Created a Dockerfile

FROM searxng/searxng:latest
RUN pip install mysql-connector-python

Changed searxng/settings.yml

engines:
  - name: tunesdb
    engine: mysql_server
    host: 10.12.0.xx
    database: pipetunesearch
    username: xxxxxxx
    password: xxxxxxx
    limit: 50
    query_str: 'SELECT * from tunes WHERE tunename=%(query)s'

I could not use a like statement in de sql query .. have to look into that

    query_str: 'SELECT * from tunes WHERE tunename like %(query)%' .. doesn´t work

Example showing own data

To complete this post the reverse proxy info ..

<VirtualHost *:443>
   SSLEngine on
   SSLProxyEngine On

   SSLProtocol all -SSLv2 -SSLv3 +TLSv1
   SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:!RC4+RSA:+HIGH:+MEDIUM

   SSLCertificateFile wildcard.cer
   SSLCertificateKeyFile my.key
   SSLCertificateChainFile GlobalSignRootCA.cer
   SSLCertificateChainFile AlphaSSLCA-SHA256-G2.cer

   CustomLog /var/log/httpd/search_ssl_request_log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

    ServerAdmin webmaster@henriaanstoot.nl
    ServerName search.henriaanstoot.nl

ProxyRequests Off
ProxyPreserveHost On
SSLProxyVerify none
SSLProxyCheckPeerCN off
SSLProxyCheckPeerName off

<Location />
ProxyPass  http://dockerhostip:8080/
ProxyPassReverse  http://dockerhostip:8080/
</Location>

    ErrorLog /var/log/httpd/search.henriaanstoot.nl-error.log
    CustomLog /var/log/httpd/search.henriaanstoot.nl-access.log combined
</VirtualHost>

Add packages to a pre-existing docker image

A little test building a custom docker image, for a friend.

Q: I have a Node-red docker, but without ffmpeg binary

Using below code, i’ve added a overlay with ffmpeg.
Podman command’s should be working for docker command also.
(Note: When adding multiple packages OR other commands, try to use a single commandline, Every RUN command adds a overlay.

mkdir noderedbuild
cd  noderedbuild
vi Dockerfile
FROM nodered/node-red
LABEL description="Custom Nodered Build"
MAINTAINER haanstoot <fash@fash.nu>
USER root
RUN apk add  --no-cache ffmpeg
EXPOSE 1880

Below builds a local image named nodered:v1
NOTE: docker run command may be incomplete for Node-Red, this was just a example to add packages

podman build -t nodered:v1 .    
podman images
docker run -it -p 1880:1880 -v node_red_data:/data --name mynodered localhost/nodered:v1 -d

Tested with

[root@podman ~]# podman exec -it mynodered /bin/bash
bash-5.0# ffmpeg
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers

Usage:

https://flows.nodered.org/flow/127b038961f873d1babeecaf5578959e

RTSP Frame save in Node-Red