<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="129759" data-post-id="129759">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="maz" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/maz/120/6075_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  maz
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I see, that <code>docker-compose run olivetree env</code> call should help, thanks. I think the next thing could try is var substitution in the environment: section. So something like:</p>
<p>docker-compose.yml:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">    environment:
      DATABASE_URL: ecto://olivetree:olivetree@postgres/olivetree
      HOSTNAME: localhost
      PORT: 4000
      GUARDIAN_SECRET_KEY: ${GUARDIAN_SECRET_KEY}
      ...
</code></pre>
<p><code>(source env vars at command line) OR $ export GUARDIAN_SECRET_KEY=efaw77aw6wfea6f</code><br>
<code>docker-compose up</code></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="129759" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/load-env-vars-with-docker-compose-env-file-secrets/22685/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-129759" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="129759"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="129760" data-post-id="129760">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="jola" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/jola/120/18010_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  jola
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>You can get it to resolve at runtime by calling it in your code (as opposed to having it in config files, or module attributes, both of which resolve at build time). Some dependencies support taking config options at runtime, like <a href="https://hexdocs.pm/ecto/Ecto.Repo.html#content" rel="noopener nofollow ugc">Ecto</a>. If, however, you want to configure eg dependencies using <code>config/config.exs</code> et al at runtime, Distillery supports it either through <a href="https://hexdocs.pm/distillery/extensibility/config_providers.html" rel="noopener nofollow ugc">Config Providers</a> or by setting <code>REPLACE_OS_VARS=true</code> and then defining your config like</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">config :hello, Hello.Repo,
  username: "${DATABASE_USER}",
  password: "${DATABASE_PASS}",
  hostname: "${DATABASE_HOST}",
  database: "${DATABASE_NAME}",
  port: "${DATABASE_PORT}",
  pool_size: 15
</code></pre>
<p>replace with your own options and env variables.</p>
<p>There’s more information in the DIstillery guide for working with Docker <a href="https://hexdocs.pm/distillery/guides/working_with_docker.html" class="inline-onebox" rel="noopener nofollow ugc">Deploying With Docker - Distillery Documentation</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="129760" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/load-env-vars-with-docker-compose-env-file-secrets/22685/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-129760" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="129760"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="129762" data-post-id="129762">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="maz" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/maz/120/6075_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  maz
                      <span class="op-star" title="Thread Starter">
                        <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                      </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Yeah, thanks for reminding me of Config Providers. I may end up needing to stop fighting Docker and use that instead.</p>
<p>EDIT: there are some good tips in there about using docker-compose too, guess I’ll try that first.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="129762" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/load-env-vars-with-docker-compose-env-file-secrets/22685/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-129762" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="129762"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>