This commit is contained in:
parent
b48bf6cf72
commit
4881226246
2 changed files with 6 additions and 7 deletions
|
|
@ -22,4 +22,4 @@ steps:
|
|||
# tell the Dockerfile about the commit SHA and build date
|
||||
build_args:
|
||||
COMMIT_SHA: ${CI_COMMIT_SHA:0:7}
|
||||
BUILD_DATE: ${CI_PIPELINE_CREATED}
|
||||
COMMIT_MESSAGE: ${CI_COMMIT_MESSAGE}
|
||||
|
|
|
|||
11
Dockerfile
11
Dockerfile
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
# For a containerized dev environment, see Dev Containers: https://guides.rubyonrails.org/getting_started_with_devcontainer.html
|
||||
|
||||
ARG COMMIT_SHA
|
||||
ARG BUILD_DATE
|
||||
#ARG COMMIT_SHA
|
||||
#ARG BUILD_DATE
|
||||
|
||||
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
|
||||
ARG RUBY_VERSION=3.2.4
|
||||
|
|
@ -73,7 +73,7 @@ RUN rm -rf node_modules
|
|||
FROM base
|
||||
|
||||
ARG COMMIT_SHA
|
||||
ARG BUILD_DATE
|
||||
ARG COMMIT_MESSAGE
|
||||
|
||||
# Copy built artifacts: gems, application
|
||||
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
|
||||
|
|
@ -81,9 +81,8 @@ COPY --from=build /rails /rails
|
|||
|
||||
# Add build information so we can check if the deployment works
|
||||
RUN echo "Commit SHA: ${COMMIT_SHA}" > /rails/public/versioninfo && \
|
||||
echo "Build Date: ${BUILD_DATE}" >> /rails/public/versioninfo
|
||||
|
||||
RUN echo "XXXDEBUG: SHA is [${COMMIT_SHA}] and DATE is [${BUILD_DATE}]"
|
||||
echo "Commit message: ${COMMIT_MESSAGE}" >> /rails/public/versioninfo
|
||||
RUN echo "versioninfo: SHA is [${COMMIT_SHA}] and DATE is [${BUILD_DATE}]"
|
||||
|
||||
# Run and own only the runtime files as a non-root user for security
|
||||
RUN groupadd --system --gid 1000 rails && \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue