File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
railties/lib/rails/generators/rails/app/templates Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -103,16 +103,15 @@ RUN rm -rf node_modules
103
103
# Final stage for app image
104
104
FROM base
105
105
106
- # Copy built artifacts: gems, application
107
- COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
108
- COPY --from=build /rails /rails
109
-
110
106
# Run and own only the runtime files as a non-root user for security
111
107
RUN groupadd --system --gid 1000 rails && \
112
- useradd rails --uid 1000 --gid 1000 --create-home --shell /bin/bash && \
113
- chown -R rails:rails <%= dockerfile_chown_directories.join(" ") %>
108
+ useradd rails --uid 1000 --gid 1000 --create-home --shell /bin/bash
114
109
USER 1000:1000
115
110
111
+ # Copy built artifacts: gems, application
112
+ COPY --chown=rails:rails --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
113
+ COPY --chown=rails:rails --from=build /rails /rails
114
+
116
115
# Entrypoint prepares the database.
117
116
ENTRYPOINT ["/rails/bin/docker-entrypoint"]
118
117
You can’t perform that action at this time.
0 commit comments