Running and Deploying Rails to Docker Container Running and Deploying Rails to Docker Container docker docker

Running and Deploying Rails to Docker Container


If I were to employ Docker, where would my app sit?

It could sit inside the container or it could sit on the host(you can use docker build to copy the app into the container)

How would I deploy (production) and share directories (development)?

Deploying your app would mean committing your local container into an image, publishing itand running a container out of the published images on your servers. I have not tried sharing directories between host and container, but you can try this : https://gist.github.com/jpetazzo/5668338 . You can also write a Dockerfile which can copy a directory to a target in the container. Docker's docs on building images will help you there.

Can I run all my additional services ie memcache, redis, postgresql, etc on the same server using docker?

Yes. You will be running multiple containers on the same server.


I'm no expert and I haven't even used docker myself, but as I understand it, your app sits inside a docker container. You would deploy ideally a whole container with your own ruby version installed and so on.

The big benefit is, that you can test exactly the same container in your staging system that you're going to ship to production then. So you're able to test the complete system with all installed C extensions, the exact same ls command and so on.