parent
6012898d9b
commit
96c0f677aa
2 changed files with 11 additions and 7 deletions
|
|
@ -7,6 +7,9 @@
|
|||
|
||||
# For a containerized dev environment, see Dev Containers: https://guides.rubyonrails.org/getting_started_with_devcontainer.html
|
||||
|
||||
ARG COMMIT_SHA
|
||||
ARG BUILD_DATE
|
||||
|
||||
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
|
||||
ARG RUBY_VERSION=3.2.4
|
||||
FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base
|
||||
|
|
@ -72,6 +75,10 @@ FROM base
|
|||
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
|
||||
COPY --from=build /rails /rails
|
||||
|
||||
# Add build information so we can check if the deployment works
|
||||
RUN echo "Commit SHA: ${COMMIT_SHA}" > /app/public/versioninfo && \
|
||||
echo "Build Date: ${BUILD_DATE}" >> /app/public/versioninfo
|
||||
|
||||
# Run and own only the runtime files as a non-root user for security
|
||||
RUN groupadd --system --gid 1000 rails && \
|
||||
useradd rails --uid 1000 --gid 1000 --create-home --shell /bin/bash && \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue