# Environment variable using docker-compose is always null

**URL:** <https://forum.elixirforum.com/t/environment-variable-using-docker-compose-is-always-null/41073>\
**Category:** Questions\
**Tags:** docker, docker-compose\
**Created:** [July 16, 2021, 1:10am UTC](https://forum.elixirforum.com/t/environment-variable-using-docker-compose-is-always-null/41073 "2021-07-16T01:10:45Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![stefanchrobot](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/stefanchrobot/32/7657_2.png) [@stefanchrobot](https://forum.elixirforum.com/u/stefanchrobot)\
**Post date:** [July 16, 2021, 6:26am UTC](https://forum.elixirforum.com/t/environment-variable-using-docker-compose-is-always-null/41073/2 "2021-07-16T06:26:42Z")

</div>

It works the same. Just make sure you’re not fetching the ENV variables in `config/config.exs` or `config/prod.exs` - those are evaluated at build time. Either [use `config/runtime.exs`](https://elixir-lang.org/getting-started/mix-otp/config-and-releases.html#configuration) or read in the app.

---

_[View the full topic](https://forum.elixirforum.com/t/environment-variable-using-docker-compose-is-always-null/41073)._
