Title

Rails with Docker: How to set up your Compose stack for Rails with Tailwind CSS

Summary

This video guide walks you through the process of setting up, installing, and initiating a new Rails application using the Tailwind CSS framework with Docker. It begins with installing Docker Desktop and checking out a GitHub repository with example code. Then, the guide moves on to setting up a Docker Compose stack and a Dockerfile for the app service.

Next, we walk through installing Rails in a container, creating a new Rails app, and building the Compose stack. We then run a Rails console in an app service container and start a Rails server with the Compose stack. We also cover how to define and start a Tailwind watcher service with the Compose stack.

In the latter part of the video, we generate a Post scaffold in an app service container and run tests in the same container. Throughout the guide, we troubleshoot any issues that come up and explain how to resolve them. By the end of this video, you'll be able to create a Rails application with the Tailwind CSS framework using Docker.

Transcript

Intro

The Ruby on Rails web-app framework, powers renowned platforms like GitHub, GitLab, AirBnB, Shopify, Twitch and many more.

Another popular choice for designing web-apps is Tailwind, a utility-first CSS framework used by OpenAI’s ChatGPT, Shopify and Loom amongst others.

In this video, I'll guide you through the process of setting up, installing, and initiating a new Rails application using Tailwind with Docker.

Install Docker

First of all, you need to download and install Docker Desktop from docker.com.

As a Mac user, make sure to select the right chip.

As a Windows user, make sure to install and use WSL.

Check the Github repository with example code

You can view and clone the source code for the example from the Github repository at profankhauser/examples. The link is in the description.

Setup the Docker Compose stack