1

I have deis(1.5.2) with 3 host and I want "app" with database. I want to use postgres, so I found this docker image https://registry.hub.docker.com/_/postgres/ . I did deploy without problems, but I don't know how can I connect into this app/container (create some db, users) and link with other app/container. They write commands for it but it's for docker. So how can I run these commands from deis:

docker run --name some-app --link some-postgres:postgres -d application-that-uses-postgres

docker run -it --link some-postgres:postgres --rm postgres sh -c 'exec psql -h "$POSTGRES_PORT_5432_TCP_ADDR" -p "$POSTGRES_PORT_5432_TCP_PORT" -U postgres'

or do you have some other solution for using DB with deis?

quatermain
  • 1,442
  • 2
  • 18
  • 33
  • Hi! You may want to take a look at a similar question: http://stackoverflow.com/questions/23298732/how-can-i-setup-and-deploy-a-database-with-deis-paas – bacongobbler Apr 25 '15 at 07:34
  • @bacongobbler thank you, I know about it, but my question is more specific, because I don't need only simple DB, I will need redis, elasticsearch, etc.... – quatermain Apr 25 '15 at 11:48
  • The idea is the same as Heroku. Deis does not stand up backing services for your application as of now. You'll have to set up an external backing service like redis, elasticsearch, postgres, etc. external to the cluster and connect them to the application through `deis config:set`: http://docs.deis.io/en/latest/using_deis/config-application/#attach-to-backing-services – bacongobbler Apr 28 '15 at 16:30
  • yes, I know, but my question is not about how can I get data into the app, but how can I get data from the app and in this situation app is mysql/redis server. And deis use docker, so docker support link two containers. So 1. question is how can I connect into the app and use psql console. 2. question: is possible to link two containers same like docker does it. – quatermain Apr 28 '15 at 16:51
  • 1. `deis run`, though there's [an open issue](https://github.com/deis/deis/issues/117) for interactive consoles. 2. Docker links expose the connection through environment variables. `deis config:set` sets up environment variables, but there's no way to "discover" backing services, so you have to know the connection details as I mentioned in my previous comment. – bacongobbler May 03 '15 at 20:41

0 Answers0