Best practice of using database


#1

When using Shinyproxy, sometimes the app(or multiple apps) needs to access a database. I’m wondering what is the best practice of using database with Shinyproxy. I would prefer the database to be running in a container as well and persist the data in a dock volume. The problem is how to access that database properly?

Thanks.


Setting up MonetDB
Access local mongo database from container
#2

Hi @Keqiang_Li,

In this blog post https://www.openanalytics.eu/blog/2017/11/12/shinyproxy-1.0.2/ there is a section ‘Larger Applications and Networks’ which demonstrates how to do this:

  • create a network for the db using docker network create e.g. db-network
  • run your DB container using docker run with the --net option to run it inside the ‘db-network’
  • make sure an interface is configured on the Shiny app container using the docker-network-connections field where you specify this same db-network as the value

Hope this helps!

Best,
Tobias


#3

Great! It’s exactly what I’ve been looking for. Didn’t know this new configuration. This is really exciting because now different apps can be configured on different networks. Can’t wait to give it a go. Appreciate your work!

Thanks!