Re:WTF is a container?
by holografix on Thursday October 20, 2016 @03:06AM
(#12750251)
Thanks chewchew so much win in this reply. I use Heroku a lot and was wondering if there is a "believable" alternative using Docker.
If you want to use your own Linux host, then the simplest way would probably just be to SSH into the box, git pull, and run "docker-compose build && docker-compose up".
Setting environment variables is pretty easy, but I don't think you need them in this case. If you're trying to make a redis or postgres container available to another container (your app), then you can do so easily with links in docker-compose. Something like:
You can then access redis from the myapp service using the hostname "redis" and the default port "6379". So, "telnet redis 6379" would work from the myapp container (assuming telnet is actually installed). The redis port isn't even publicly exposed- it's only available to myapp.If you need to define environment variables, you can do so with an environment dict as shown above. There are a few other ways to define env vars:
https://docs.docker.com/compose/compose-file/#variable-subst...
https://docs.docker.com/compose/environment-variables/#/the-...