# Dockerizing a Rails application

DevFeed: [Dockerizing a Rails application](<https://devfeed.tech/articles/dockerizing-a-rails-application-37444.md>)

Original publisher: [Read original article](<https://iridakos.com/programming/2019/04/07/dockerizing-a-rails-application>)

Author: Lazarus Lazaridis

Published: 2019-04-07T01:00:00Z

Content type: tutorial

Language: en

Sources: [Lazarus Lazaridis](<https://devfeed.tech/sources/lazarus-lazaridis.md>)

Topics: [Docker](<https://devfeed.tech/topics/docker.md>), [Rails](<https://devfeed.tech/topics/rails.md>), [container](<https://devfeed.tech/topics/container.md>), [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Redis](<https://devfeed.tech/topics/redis.md>), [Dockerfile](<https://devfeed.tech/topics/dockerfile.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [configuration](<https://devfeed.tech/topics/configuration.md>), [Ubuntu](<https://devfeed.tech/topics/ubuntu.md>), [Development](<https://devfeed.tech/topics/development.md>)

Tags: [actioncable](<https://devfeed.tech/tags/actioncable.md>), [apt](<https://devfeed.tech/tags/apt.md>), [certificates](<https://devfeed.tech/tags/certificates.md>), [chat](<https://devfeed.tech/tags/chat.md>), [cli](<https://devfeed.tech/tags/cli.md>), [configuration](<https://devfeed.tech/tags/configuration.md>), [container](<https://devfeed.tech/tags/container.md>), [curl](<https://devfeed.tech/tags/curl.md>), [docker](<https://devfeed.tech/tags/docker.md>), [docker-image](<https://devfeed.tech/tags/docker-image.md>), [installation](<https://devfeed.tech/tags/installation.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [programming](<https://devfeed.tech/tags/programming.md>), [rails](<https://devfeed.tech/tags/rails.md>), [redis](<https://devfeed.tech/tags/redis.md>), [ruby](<https://devfeed.tech/tags/ruby.md>), [run](<https://devfeed.tech/tags/run.md>), [tutorial](<https://devfeed.tech/tags/tutorial.md>), [ubuntu](<https://devfeed.tech/tags/ubuntu.md>)

## AI overview

A tutorial on Dockerizing a Rails chat application. It covers installing Docker, configuring the application for PostgreSQL, building a Docker image with a Dockerfile, and running PostgreSQL, Redis, and application containers.

## Source excerpt

Hey! In this post we are going to: create a docker image for the Rails chat application that we created in the previous post configure the Docker environment and run the application by: creating a container for the PostgreSQL database creating a container for the Redis server creating a container with the required configuration from the image we built Prerequisites Install docker The first thing you need in order to follow this tutorial is to install Docker on your machine. We are going to use the Docker Community Edition. Follow the installation instructions matching your system. I'm on Ubuntu 18.04 LTS so following the instructions, I had to: Uninstall previous versions with: sudo apt-get remove docker docker-engine docker.io containerd runc I chose to install the application using the repository. sudo apt-get update sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg-agent \ software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - and I verified that I had the key with the proper fingerprint after executing: sudo apt-key fingerprint 0EBFCD88 I set up the repository with: sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" The installation took place with these commands: sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io I checked that the installation was successful with: $ sudo docker run hello-world Unable to find image 'hello-world:latest' locally latest: Pulling from library/hello-world 1b930d010525: Pull complete Digest: sha256:... Status: Downloaded newer image for hello-world:latest Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new