this doesn't explain as to why the env variables didn't work though
Maybe you defined the env variables outside the container? Maybe incorrect usage on your end? The env variables work when properly configured.
My guess would be something related to your environments.