Use a Single Docker Project to Host All Your Database Containers

Get Redis, SQL Server, MongoDB, and more up and running in docker in 15 mins!

Shawn Shi
Shawn Shi
May 5 · 4 min read
Image credit to Frank Mckenna from unsplash.com

Background

Let me start by asking and answering a few quick questions:

  • Have you installed Redis on your dev machine? Yes, I have.
  • Have you installed all the other databases that you temporarily need on your dev machine? Yes, I have….
  • Do you need them all running in the background on your dev machine, eating all the CPU and Memory, until the world ends? No, I do not…

Goal

The goal is to share how I overcome the challenge of having to install databases I need and then uninstall them, simply, by using docker.

cd 'C:\sandbox'
docker-compose -p "database-playground" up
Screenshot by Author

Conclusion

In about 15 mins time, we are able to get three database instances, Redis, SQL Server and Mongo, up and running. We also get the benefit of being able to easily turn them on and off either as a whole project or individually. Awesome!

Geek Culture

Proud to geek out. Follow to join our +500K monthly readers.

Shawn Shi

Written by

Shawn Shi

Software Engineer, Machine Learning Engineer. When I am not dived into data and code, I am hanging out with my young daughter or outside rock climbing!

Geek Culture

A new tech publication by Start it up (https://medium.com/swlh).

Shawn Shi

Written by

Shawn Shi

Software Engineer, Machine Learning Engineer. When I am not dived into data and code, I am hanging out with my young daughter or outside rock climbing!

Geek Culture

A new tech publication by Start it up (https://medium.com/swlh).

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store