Skip to content

Commit cb72a91

Browse files
authored
Merge pull request rails#51445 from shouichi/remove-node-modules-from-the-final-image
Remove node_modules from the final image
2 parents 87e70a2 + 7c79689 commit cb72a91

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
7878

7979
<% end -%>
8080

81+
<% if using_node? -%>
82+
RUN rm -rf node_modules
83+
<% end %>
84+
8185
# Final stage for app image
8286
FROM base
8387

0 commit comments

Comments
 (0)