10

I'm trying to setup a database with Deis. I know this is possible, but there doesn't seem to be any documentation about how to do it other than setting an ENV variable.How could I setup say a MongoDB or Cassandra docker container and then deploy that and have my deis app use it?

Cameron A. Ellis
  • 3,833
  • 8
  • 38
  • 46

1 Answers1

8

If you're trying to deploy now, a possible solution is to set up a docker container, have it publicly route-able, and then configure your application to use that container through an environment variable following Heroku's 12 factor app best practices. There is a feature request for a Deis service gateway that will act like Heroku's Add-on Marketplace, but it's not there yet.

Quyen Nguyen Tuan
  • 1,677
  • 17
  • 23
bacongobbler
  • 867
  • 6
  • 14
  • 2
    I'm going to investigate the best way of adding a new "service" container to a machine on my cluster, running Postgresql or Redis. Dokku makes this very easy, with plugins. Something similar here, would be awesome. I'm also wondering (in a separate question) if the Redis and Postgresql databases backing the Deis cache and database service containers are accessible? – Johnny Hall May 04 '14 at 17:15
  • 1
    The equivalent to Dokku plugins would be the issue I listed above (https://github.com/deis/deis/issues/231). The redis and psql databases are accessible through the etcd keys /deis/cache and /deis/database, but it's highly recommended that these components stay strictly in use for Deis components only. – bacongobbler May 05 '14 at 15:00
  • @bacongobbler the deis documentation could use some clarification. For instance, there is http://docs.deis.io/en/latest/managing_deis/database_settings/#database-settings which mentions the built in db. But it seems this is only being used for Deis *itself*, not an end-user's application state (e.g. a rails app deployed with deis would NOT use that db). Is that correct? – Cameron A. Ellis Jul 01 '14 at 16:44
  • 1
    correct. That database is strictly for platform use. – bacongobbler Jul 01 '14 at 17:33
  • @bacongobbler: I would like to confirm if your answer in April still hold true now? Specifically, I deployed [tutum-docker-mysql Dockerfile](https://github.com/tutumcloud/tutum-docker-mysql) to Deis. Does the current port redirection from deis-router(80) to the mysql app container(whatever port docker used) only hold for HTTP requests, or any kind of request? If it is only for http, is there a way to externally connect to a mysql service run on Deis now? Thanks. – Jimmy Chu Dec 01 '14 at 12:01
  • The answer still holds. The router only supports HTTP and websocket-based applications, and that feature request is still open. You won't be able to create a TCP connection from a client to your application. – bacongobbler Dec 01 '14 at 21:30