Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails guide upgrade (part 2) #22114

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Renamed Configure CI/CD section to GitHub Actions automation
  • Loading branch information
igor-alexandrov committed Feb 25, 2025
commit b1c612fa6e379f26b74ae91d129f813da7907d28
3 changes: 2 additions & 1 deletion content/guides/ruby/_index.md
Original file line number Diff line number Diff line change
@@ -12,15 +12,16 @@ aliases:
- /language/ruby/
- /guides/language/ruby/
languages: [ruby]
tags: [frameworks]
params:
time: 20 minutes
---

The Ruby language-specific guide teaches you how to containerize a Ruby on Rails application using Docker. In this guide, you’ll learn how to:

- Containerize and run a Ruby on Rails application
- Configure a GitHub Actions workflow to build and push a Docker image to Docker Hub
- Set up a local environment to develop a Ruby on Rails application using containers
- Configure a CI/CD pipeline for a containerized Ruby on Rails application using GitHub Actions
- Deploy your containerized Ruby on Rails application locally to Kubernetes to test and debug your deployment

Start by containerizing an existing Ruby on Rails application.
132 changes: 0 additions & 132 deletions content/guides/ruby/configure-ci-cd.md

This file was deleted.

6 changes: 3 additions & 3 deletions content/guides/ruby/containerize.md
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ Starting from Rails 7.1 [Docker is supported out of the box](https://guides.ruby

If you have an existing Rails application, you will need to create the Docker assets manually. Unfortunately `docker init` command does not yet support Rails. This means that if you are working with Rails, you'll need to copy Dockerfile and other related configurations manually from the examples below.

## Initialize Docker assets
## 1. Initialize Docker assets

Rails 7.1 generates multistage Dockerfile out of the box, below is an example of such file generated from a Rails template.

@@ -232,7 +232,7 @@ To learn more about the files, see the following:
- [compose.yaml](/reference/compose-file/_index.md)
- [docker-entrypoint](/reference/dockerfile/#entrypoint)

## Run the application
## 2. Run the application

To run the application, run the following command in a terminal inside the application's directory.

@@ -244,7 +244,7 @@ Open a browser and view the application at [http://localhost:3000](http://localh

In the terminal, press `ctrl`+`c` to stop the application.

### Run the application in the background
## 3. Run the application in the background

You can run the application detached from the terminal by adding the `-d`
option. Inside the `docker-ruby-on-rails` directory, run the following command
4 changes: 2 additions & 2 deletions content/guides/ruby/deploy.md
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ In your `docker-ruby-on-rails` directory, create a file named
`docker-ruby-on-rails-kubernetes.yaml`. Open the file in an IDE or text editor and add
the following contents. Replace `DOCKER_USERNAME/REPO_NAME` with your Docker
username and the name of the repository that you created in [Configure CI/CD for
your Ruby on Rails application](configure-ci-cd.md).
your Ruby on Rails application](configure-github-actions.md).

```yaml
apiVersion: apps/v1
@@ -68,7 +68,7 @@ In this Kubernetes YAML file, there are two objects, separated by the `---`:
you'll get just one replica, or copy of your pod. That pod, which is
described under `template`, has just one container in it. The
container is created from the image built by GitHub Actions in [Configure CI/CD for
your Ruby on Rails application](configure-ci-cd.md).
your Ruby on Rails application](configure-github-actions.md).
- A NodePort service, which will route traffic from port 30001 on your host to
port 8001 inside the pods it routes to, allowing you to reach your app
from the network.
2 changes: 1 addition & 1 deletion content/guides/ruby/develop.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Use containers for Ruby on Rails development
linkTitle: Develop your app
weight: 20
weight: 40
keywords: ruby, local, development
description: Learn how to develop your Ruby on Rails application locally.
aliases: