You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/guides/ruby/containerize.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,15 +22,15 @@ This section walks you through containerizing and running a [Ruby on Rails](http
22
22
23
23
Starting from Rails 7.1 [Docker is supported out of the box](https://guides.rubyonrails.org/7_1_release_notes.html#generate-dockerfiles-for-new-rails-applications). This means that you will get a `Dockerfile`, `.dockerignore` and `bin/docker-entrypoint` files generated for you when you create a new Rails application.
24
24
25
-
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.
25
+
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.
26
26
27
27
## Initialize Docker assets
28
28
29
29
Rails 7.1 generates multistage Dockerfile out of the box, below is an example of such file generated from a Rails template.
30
30
31
-
> Multistage Dockerfiles help create smaller, more efficient images by separating build and runtime dependencies, ensuring only necessary components are included in the final image. Read more about multi-stage builds [in a dedicated article](/get-started/docker-concepts/building-images/multi-stage-builds/)
31
+
> Multistage Dockerfiles help create smaller, more efficient images by separating build and runtime dependencies, ensuring only necessary components are included in the final image. Read more in the [Multi-stage builds guide](/get-started/docker-concepts/building-images/multi-stage-builds/).
32
32
33
-
Even though the Dockerfile is generated for you, it's a good idea to understand what it does and how it works, so we recommend reading the following example.
33
+
Although the Dockerfile is generated automatically, understanding its purpose and functionality is important. Reviewing the following example is highly recommended.
34
34
35
35
36
36
```dockerfile {title=Dockerfile}
@@ -135,7 +135,7 @@ EXPOSE 3000
135
135
CMD ["./bin/rails", "server"]
136
136
```
137
137
138
-
We specified the Docker entrypoint as`./bin/docker-entrypoint`which is a script that prepares the database and runs the application server. Below is an example of such a script.
138
+
This Dockerfile uses a script at`./bin/docker-entrypoint`as the container's entrypiont. This script prepares the database and runs the application server. Below is an example of such a script.
139
139
140
140
```bash {title=docker-entrypoint}
141
141
#!/bin/bash -e
@@ -206,7 +206,7 @@ Besides the two files above you will also need a `.dockerignore` file. This file
206
206
/Dockerfile*
207
207
```
208
208
209
-
The last thing that may be necessary, but not always required is `compose.yml` file, used by Docker Compose to define the services that make up your application. Since we are using SQLite as the database, we don't need to define a separate service for the database, and the only service we need is the Rails application itself.
209
+
The last optional file that you may want is the `compose.yaml` file, which is used by Docker Compose to define the services that make up the application. Since SQLite is being used as the database, there is no need to define a separate service for the database. The only service required is the Rails application itself.
0 commit comments