xirixiz / dsmr-reader-docker

DSMR Reader in Docker.
https://hub.docker.com/r/xirixiz/dsmr-reader-docker
112 stars 33 forks source link

Support for docker secrets #354

Closed frankforpresident closed 2 months ago

frankforpresident commented 2 months ago

@xirixiz,

After conducting thorough research, I've discovered a method to enable Docker secrets by implementing an entry script. This script populates the necessary environment variables before initiating the application. This pull request is inspired by this repository, and I've made modifications to enhance its functionality, specifically by adding generic support for the _FILE postfix.

I've also included a comprehensive example to demonstrate how the script should be utilized.

xirixiz commented 2 months ago

Perfect! Thanks @frankforpresident! Appreciated very much. Currently a big change is being implemented (development branch). Once the changes have been confirmed working properly for hassio, I will merge the dev branch to the main branch and also merge your PR. Approx somewhere upcoming week.

thijskuijpers commented 3 days ago

I am trying to use the secrets but the version with postfix _FILE does not work for me. Also using the DOCKER-SECRET->dsmrreader_admin_password does not work, it uses this exact string as password. Finally tried the FILE__ prefix as mentioned in the manual but that does not work either and I cannot find this prefix in the code. So I expect the first two options should work, but maybe I miss something in my docker compose script. Any help is appreciated, thanks!

dsmr: image: ghcr.io/xirixiz/dsmr-reader-docker:latest depends_on: dsmrdb: condition: service_healthy container_name: dsmr links:

secrets: dsmrreader_admin_password: file: /share/Docker_DSMR/Secrets/dsmr_pass.txt