How to run a Rails 6 application using Docker Compose

How to run a Rails 6 application using Docker Compose

In the previous article we learned how to create a Rails 6 Docker image and run it locally. While useful for demonstration purposes, it is not enough for a real-world web application. In addition to our main application code, there are other services that we also need, like a database, a queue system, storage and so on.

Docker Compose provides a way for us to describe how our entire application works using declarative code. Declarative code means that we specify the final state of our application, rather than specifying what steps are needed to create our application. This results in a simpler, more intuitive configuration. Continue Reading

How to build a Rails 6 application using Docker

How to build a Rails 6 application using Docker

In the Introduction to Docker article, we developed a good basic foundational knowledge about container technology. Now, we will take it one step further by creating and running a Rails 6 application exclusively using Docker. As of this writing, Rails 6 is the latest version of the Ruby on Rails web application framework.

Generating the Rails code

We learned previously that we can run Ruby code using Docker even without having Ruby in our local machine. We can also use the container’s shell and run commands directly in the container. Using these, let’s try to perform some commands in a container running Ruby 2.7: Continue Reading

Introduction to Docker

Introduction to Docker

Docker is perhaps responsible for the proliferation of containers in application development. The concept of containers is quite old, and can be traced back in the 1980s by chroot wherein different user spaces can be used within the same operating system. Once Docker was introduced however, it paved the way for further developments in containerization and changed the way how we develop and deploy software.

In this article we will discuss how to install and setup Docker in your local machine. Common Docker commands will be introduced that will equip you with foundational knowledge for tackling the next steps in application development using containers (such as Compose). Continue Reading

Path of Least Regret

As we live and get older, we learn a lot of things about life. Good and bad experiences serve us lessons and make us more equipped when dealing with our unpredictable future. We can also tap other people’s experiences to open us to new ideas. These thoughts were highlighted one day when my wife said that she appreciated my calm demeanor even though things are not going well. While I am not always like this, when I think about it, I attribute this behavior to one principle: living life on the path of least regret.

Choosing the easiest path versus the path of least regret
Which path does not make my feet hurt?

In electronic theory, we have something called the path of least resistance. Generally, most of the electric current will flow in the path where the resistance is lowest. In the outside world, people will tend to choose things that are easiest for them to do. When choosing a trail to a destination, many choose the path that looks easier and quicker to traverse. Continue Reading

Surviving and Thriving in a Recession

Surviving and Thriving in a Recession

When a recession hits, it affects many people and industries across the world. Even if you think that your industry is not affected, your company can still be hit due to knock-on effects. Revenue becomes harder if your clients are affected or if they realign their budgets. If this persists for several months, it can result to layoffs and furloughs.

Protect your income

It is with this increased risk that we should protect our sources of income as much as possible. If you run a business, then this is the time to optimize operations and reduce unnecessary expenses. Look into each recurring expense and determine whether it is critical for your business. You may be surprised to know that some of them can be eliminated without affecting your operations. Continue Reading