Starting a Postgres Server

Here we will start to learn about the database that we want to add in our app.

Postgres server

We want to run a Postgres server for our Rails app to use. The process is very similar to adding Redis. In the previous chapter, we started by familiarizing ourselves with how to run the Redis server with docker run. However, now that we have had some experience with adding a service, we can jump straight to setting up Postgres directly with Compose.

Modification of docker-compose.yml

Let’s add Postgres to our docker-compose.yml file:

Get hands-on with 1200+ tech skills courses.