|
|
|
|
|
by chewchew
3535 days ago
|
|
The absolute easiest is probably Docker Cloud. I've checked it out but haven't really used it much. It's still relatively immature but if you just want to deploy and forget something simple, this is probably the way to go. 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: myapp:
image: myimage:0.0.1
command: cmd to run
links:
- redis:redis
ports:
- 80:8000
environment:
- hardcoded_var=my_env_value
- var_from_host=${host_var}
redis:
image: redis:latest
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-... |
|