Skip to content

Commit c8780e2

Browse files
authored
Merge pull request rails#47577 from rubys/dockerfile-cosmetics
dockerfile cosmetics:
2 parents aa2052e + 869e42f commit c8780e2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

railties/lib/rails/generators/rails/app/templates/Dockerfile.tt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax = docker/dockerfile:1
22

3-
# Make sure it matches the Ruby version in .ruby-version and Gemfile
3+
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
44
ARG RUBY_VERSION=<%= Gem.ruby_version %>
55
FROM ruby:$RUBY_VERSION-slim as base
66

@@ -17,15 +17,14 @@ ENV RAILS_ENV="production" \
1717
# Throw-away build stage to reduce size of final image
1818
FROM base as build
1919

20-
# Install packages need to build gems<%= using_node? ? " and node modules" : "" %>
20+
# Install packages needed to build gems<%= using_node? ? " and node modules" : "" %>
2121
RUN apt-get update -qq && \
2222
apt-get install -y <%= dockerfile_build_packages.join(" ") %>
2323

2424
<% if using_node? -%>
2525
# Install JavaScript dependencies
2626
ARG NODE_VERSION=<%= dockerfile_node_version %>
2727
ARG YARN_VERSION=<%= dockerfile_yarn_version %>
28-
2928
ENV PATH=/usr/local/node/bin:$PATH
3029
RUN curl -sL https://github.com/nodenv/node-build/archive/master.tar.gz | tar xz -C /tmp/ && \
3130
/tmp/node-build-master/bin/node-build "${NODE_VERSION}" /usr/local/node && \
@@ -68,6 +67,7 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
6867
# Final stage for app image
6968
FROM base
7069

70+
# Install packages needed for deployment
7171
RUN apt-get update -qq && \
7272
apt-get install --no-install-recommends -y <%= dockerfile_deploy_packages.join(" ") %> && \
7373
rm -rf /var/lib/apt/lists /var/cache/apt/archives

0 commit comments

Comments
 (0)