<p>I would recommend running containers using docker-compose and use &quot;environment&quot; directive.
<a href="https://docs.docker.com/compose/gettingstarted/" rel="nofollow noreferrer">https://docs.docker.com/compose/gettingstarted/</a></p>
<p>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.</p>
<p><a href="https://docs.docker.com/compose/environment-variables/" rel="nofollow noreferrer">https://docs.docker.com/compose/environment-variables/</a></p>
<p>If you don't want use docker-compose, you can use --env flag:</p>
<pre><code>docker run --env VAR1=value1 --env VAR2=value2 ubuntu env 
</code></pre>

CC BY-SA 4.0
2022-11-07T16:13:05.170Z
You can also use --env-file with docker run...
Tensibai
CC BY-SA 4.0
2022-11-07T09:10:59.530Z
2022-11-07T09:10:59.530Z
Dmitriy Dubovtsev
<p>I'm trying to install a GUI on Bitcoin Lightning Network Testnet. I have 2 lightning nodes running and connected together. Both in containers.</p>
<p>Now I would like to have a GUI interface to manage my nodes. I used this image: <a href="https://hub.docker.com/r/apotdevin/thunderhub" rel="nofollow noreferrer">https://hub.docker.com/r/apotdevin/thunderhub</a></p>
<p>I can start the container and access it on my local computer on port 3000.</p>
<p>My question is how do I configure Thunderhub to connect to my nodes ?</p>
<p>If I follow the instructions on the Thunderhub home page, they refer me to this page:</p>
<p><a href="https://docs.thunderhub.io/setup/#server-accounts" rel="nofollow noreferrer">https://docs.thunderhub.io/setup/#server-accounts</a></p>
<p>But the instructions are:</p>
<pre><code>You can add accounts on the server by adding this parameter to the .env file:
.....
</code></pre>
<p>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</p>

CC BY-SA 4.0
2022-11-07T16:11:57.427Z
From https://docs.docker.com/engine/reference/commandline/run/#options "--env-file  Read in a file of environment variables"
Tensibai
CC BY-SA 4.0
2022-11-08T00:22:17.000Z
How Did you run your thunderhub?
JRichardsz
<docker>
How do I provide a config file (.env) when starting a container?
jfjobidon
# How do I provide a config file (.env) when starting a container?

(Asked by: username_0 on 2022-11-06)

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

**Tags:** docker

> **Comments:**
> **username_1**: From https://docs.docker.com/engine/reference/commandline/run/#options "--env-file  Read in a file of environment variables"  
> **username_2**: How Did you run your thunderhub?  

---

## 1 answers

### Answer by username_3 on 2022-11-07. Score: 1

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

> **Comments:**
> **username_1**: You can also use --env-file with docker run...  

---

