How do I provide a config file (.env) when starting a container?
-
I'm trying to install a GUI on Bitcoin Lightning Network Testnet. I have 2 lightning nodes running and connected together. Both in containers.
Now I would like to have a GUI interface to manage my nodes. I used this image: https://hub.docker.com/r/apotdevin/thunderhub
I can start the container and access it on my local computer on port 3000.
My question is how do I configure Thunderhub to connect to my nodes ?
If I follow the instructions on the Thunderhub home page, they refer me to this page:
https://docs.thunderhub.io/setup/#server-accounts
But the instructions are:
You can add accounts on the server by adding this parameter to the .env file: .....
How should I proceed from there ? Does it means I must rebuild the image ? How do I provide a '.env' config file when starting a container
-
I would recommend running containers using docker-compose and use "environment" directive. https://docs.docker.com/compose/gettingstarted/
From this link above is a good example, see step 5. Also you can create .env file in the same directory as the the docker-compose.yml See examples in this link below.
https://docs.docker.com/compose/environment-variables/
If you don't want use docker-compose, you can use --env flag:
docker run --env VAR1=value1 --env VAR2=value2 ubuntu env