Containerfile: turn `SECRET_KEY_BASE` at build-time into a buildarg

this is to not have `SECRET_KEY_BASE` present in the resulting container
as it's only required to run some rake tasks
This commit is contained in:
Georg Gadinger 2023-02-04 07:13:26 +01:00
parent f14c0f1f83
commit 8f3973bbff
1 changed files with 1 additions and 2 deletions

View File

@ -65,14 +65,13 @@ RUN bundle config set without 'development test' \
&& yarn install --frozen-lockfile && yarn install --frozen-lockfile
# temporarily set a SECRET_KEY_BASE and copy config files so rake tasks can run # temporarily set a SECRET_KEY_BASE and copy config files so rake tasks can run
ENV SECRET_KEY_BASE=secret_for_build ARG SECRET_KEY_BASE=secret_for_build
RUN cp config/justask.yml.example config/justask.yml \ RUN cp config/justask.yml.example config/justask.yml \
&& cp config/database.yml.postgres config/database.yml \ && cp config/database.yml.postgres config/database.yml \
&& bundle exec rails locale:generate \ && bundle exec rails locale:generate \
&& bundle exec i18n export \ && bundle exec i18n export \
&& bundle exec rails assets:precompile \ && bundle exec rails assets:precompile \
&& rm config/justask.yml config/database.yml && rm config/justask.yml config/database.yml
ENV SECRET_KEY_BASE=
# set some defaults # set some defaults
ENV RAILS_LOG_TO_STDOUT=true ENV RAILS_LOG_TO_STDOUT=true