Deploy Dockerised Rails app


I’ve been looking into Docker recently, mainly for wanting to try it for development. I’m still working on getting my app working in Docker in dev, but as an extra thought, I wondered about whether I could use this same configuration to deploy my app to a production server.

I came across the following video, where the developer creates a droplet on Digital Ocean and gets the app running from his image.

He does this by having two docker-compose.yml files which makes sense, one for each location and the production one changes the RAILS_ENV var as expected.

At the end of the video he states that, it’s not the most ideal way to deploy a Rails app as there is a lot of other things that need to be done. Eg, Nginx, Logging and from my own thoughts, linking a domain and also adding an SSL cert.

Are there any guides or videos out there that can explain these extra parts and can explain how Docker can be used fully and properly in production with all these extra parts?

Currently, my app is not running in a Dockerised environment and I use Capistrano to deploy, it works I guess but I feel like deploying my app from a local dev docker to a production docker may be a nicer setup.

I’d love to find a workflow to easily and repeatably deploy my dockerised app from development to my DO droplet in Production mode but I can;t find anything to help or show/guide me how to achieve this.

Any ideas?

Thanks, Neil

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi there,

I believe that the most straightforward approach to deeply your Dockerized application to a production-ready environment, would be to use the DigitalOcean App platform:

You can deeply directly from Docker Hub or you could provide your Dockerfile and have your app built and deployed at the same time.

Alternatively, you could use Kubernetes for your container orchestration. Here is a good tutorial on how to do that with Rails and Kubernetes:

Hope that this helps! Regards, Bobby