E

Environment Variables Issue in Docker Compose

Summary

The user is trying to pass two environment variables, DD_LOGS_ENABLED and DATADOG_API_KEY, into a Docker container for an Elixir app but is encountering issues with these variables not being added when running locally with Docker Compose.

Status
open
Tags
    Source
    #earthly
      e

      e

      7/30/2024

      i have a target:

          FROM DOCKERFILE --build-arg MIX_ENV=dev .
      
          ARG DATADOG_API_KEY=<key>
          ARG DD_LOGS_ENABLED=true
      
          EXPOSE 4000
      
          CMD /app/datadog-init \
            scripts/wait && \
            mix setup && \
            mix phx.server```
      and i'm trying to get these two environment variables (`DD_LOGS_ENABLED` and the key) into this container but i am finding these environment variables are not being added to this container when it runs locally in docker compose... what would i need to do to get that to work?