Skip to content

Commit

Permalink
Adjust whitespace and comments on Dockerfile stages (#46966)
Browse files Browse the repository at this point in the history
* Adjust whitespace and comments on Dockerfile stages

This commit is entirely cosmetic, though the first comment has a function:

https://docs.docker.com/build/buildkit/dockerfile-frontend/

* address DHH review comments
  • Loading branch information
rubys committed Jan 12, 2023
1 parent bcc3870 commit 5625bbb
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -9,6 +9,8 @@ WORKDIR /rails
ENV RAILS_ENV="production" \
BUNDLE_WITHOUT="development"


# Throw-away build stage to reduce size of final image
FROM base as build

# Install packages need to build gems<%= using_node? ? " and node modules" : "" %>
Expand All @@ -24,8 +26,6 @@ RUN curl https://get.volta.sh | bash && \
volta install node@$NODE_VERSION yarn@$YARN_VERSION

<% end -%>


# Install application gems
COPY Gemfile Gemfile.lock ./
RUN bundle install
Expand All @@ -49,9 +49,10 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile

<% end -%>

# Final stage for app image
FROM base

# copy built artifacts: libraries, gems, application
# Copy built artifacts: libraries, gems, application
COPY --from=build /usr/lib/x86_64-linux-gnu/ /usr/lib/x86_64-linux-gnu/
COPY --from=build /usr/local/bundle /usr/local/bundle
COPY --from=build /rails /rails
Expand All @@ -65,4 +66,4 @@ ENTRYPOINT ["/rails/bin/docker-entrypoint"]

# Start the server by default, this can be overwritten at runtime
EXPOSE 3000
CMD ["./bin/rails", "server"]
CMD ["./bin/rails", "server"]

0 comments on commit 5625bbb

Please sign in to comment.