{"action":"created","issue":{"url":"https://api.github.com/repos/edgurgel/poxa/issues/45","labels_url":"https://api.github.com/repos/edgurgel/poxa/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/edgurgel/poxa/issues/45/comments","events_url":"https://api.github.com/repos/edgurgel/poxa/issues/45/events","html_url":"https://github.com/edgurgel/poxa/issues/45","id":105847057,"number":45,"title":"Add support to configs via environment variables","user":{"login":"RobertoSchneiders","id":2729095,"avatar_url":"https://avatars.githubusercontent.com/u/2729095?v=3","gravatar_id":"","url":"https://api.github.com/users/RobertoSchneiders","html_url":"https://github.com/RobertoSchneiders","followers_url":"https://api.github.com/users/RobertoSchneiders/followers","following_url":"https://api.github.com/users/RobertoSchneiders/following{/other_user}","gists_url":"https://api.github.com/users/RobertoSchneiders/gists{/gist_id}","starred_url":"https://api.github.com/users/RobertoSchneiders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobertoSchneiders/subscriptions","organizations_url":"https://api.github.com/users/RobertoSchneiders/orgs","repos_url":"https://api.github.com/users/RobertoSchneiders/repos","events_url":"https://api.github.com/users/RobertoSchneiders/events{/privacy}","received_events_url":"https://api.github.com/users/RobertoSchneiders/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-09-10T16:29:16Z","updated_at":"2015-12-11T21:55:00Z","closed_at":null,"body":"To use the docker image, I have to create a config file and copy it to the container (like [this](https://github.com/RobertoSchneiders/poxa/tree/elasticbeanstalk_deploy_instructions#deploying-on-elasticbeanstalk)). It would be easier (maybe better) to configure this settings by environment variables. \r\n\r\nI'm deploying to AWS Elastic Beanstalk and If it were possible to configure by environment variables I will be able to get the app up and running just by configuring the env vars on AWS Console and creating a file like this:\r\n\r\nDockerrun.aws.json\r\n```json\r\n{\r\n  \"AWSEBDockerrunVersion\": \"1\",\r\n  \"Image\": {\r\n    \"Name\": \"edgurgel/poxa\",\r\n    \"Update\": \"true\"\r\n  },\r\n  \"Ports\": [\r\n    {\r\n      \"ContainerPort\": \"8080\"\r\n    }\r\n  ],\r\n  \"Logging\": \"/var/log/nginx\"\r\n}\r\n```\r\n\r\nI'm new to Elixir, so, I'm not familiar with Mix. From what I understand, the [config.exs](https://github.com/edgurgel/poxa/blob/master/config/config.exs) file is already getting some configs from env vars, but, this code is executed only on docker image generation command is executed (`MIX_ENV=prod mix edip --prefix edgurgel`) and not on the application initialization. So, it doesn't help who is trying to use the docker image. Right?\r\n"},"comment":{"url":"https://api.github.com/repos/edgurgel/poxa/issues/comments/164059730","html_url":"https://github.com/edgurgel/poxa/issues/45#issuecomment-164059730","issue_url":"https://api.github.com/repos/edgurgel/poxa/issues/45","id":164059730,"user":{"login":"edgurgel","id":30873,"avatar_url":"https://avatars.githubusercontent.com/u/30873?v=3","gravatar_id":"","url":"https://api.github.com/users/edgurgel","html_url":"https://github.com/edgurgel","followers_url":"https://api.github.com/users/edgurgel/followers","following_url":"https://api.github.com/users/edgurgel/following{/other_user}","gists_url":"https://api.github.com/users/edgurgel/gists{/gist_id}","starred_url":"https://api.github.com/users/edgurgel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edgurgel/subscriptions","organizations_url":"https://api.github.com/users/edgurgel/orgs","repos_url":"https://api.github.com/users/edgurgel/repos","events_url":"https://api.github.com/users/edgurgel/events{/privacy}","received_events_url":"https://api.github.com/users/edgurgel/received_events","type":"User","site_admin":false},"created_at":"2015-12-11T21:55:00Z","updated_at":"2015-12-11T21:55:00Z","body":"Poxa doesn't have a Dockerfile as it uses `edip`. \r\n\r\nEven if you build your own image it won't load as ENV vars are load only by mix config (https://github.com/edgurgel/poxa/blob/master/config/config.exs#L9) and mix is not available as part of a release. The heroku buildpack uses mix to run it by default and that's why it works with ENV vars there.\r\n\r\nYou can always just build a docker image using mix to run it if you want to.\r\n\r\nYou would run with something like this: https://github.com/edgurgel/poxa#deploying-on-heroku"}}