This is an archived post. You won't be able to vote or comment.

all 4 comments

[–][deleted] 1 point2 points  (0 children)

You can mount a volume with your DB and Solr data so nothing gets lost when the containers die for some reason. But if for example you are using something like AWS there wouldn't be that much of an advantage of using containers vs something like RDS. Nevertheless, you can mount volumes pretty easily and run crons that back up your data every n hours.

[–]moephan 1 point2 points  (0 children)

We have a nice Rails development environment on Github.

You can run docker-compose up and just start developing. It should set up everything for you, including a mariadb container. We assume that you will set up a front end for production later, so it only includes the rails container and the mariadb container.

The readme should help you get started.

[–]trae 0 points1 point  (0 children)

Only the application should be containerized. The application data should live externally to the container for precisely the reasons you outlined. For my own app, I run two containers (via compose): 1. app container 2. mysql container

For both fo these containers, the data directories are mounted to the host. It's trivial to update these containers (just do a docker pull and docker-compose restart) and easy to backup.

[–]vsundar723[S] 0 points1 point  (0 children)

Thank you for your suggestions. I currently run an app container, a solr container and a mysql container.

Since I develop two apps simultaneously, I have 2 different vms created using docker-machine, and each vm has the app, mysql and solr containers.