From ae31438e9eb1d45cb01f76f7833e160a80d567c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Van=C3=AD=C4=8Dek?= Date: Thu, 23 Mar 2023 17:29:54 +0100 Subject: [PATCH] Asset pre-generation fails with db yml. Move it back to the Dockerfile. --- Dockerfile | 9 +++++++++ pre-entrypoint.sh | 3 --- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2401328..2f143d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,6 +21,15 @@ RUN apt-get update \ && rm -f /etc/cron.d/* \ # Install plugin dependencies \ && bundle check || bundle install \ + # For hourglass plugin \ + # fill up "database.yml" with bogus entries so the redmine Gemfile will pre-install all database adapter dependencies \ + echo '# the following entries only exist to force `bundle install` to pre-install all database adapter dependencies -- they can be safely removed/ignored' > ./config/database.yml && \ + for adapter in mysql2 postgresql sqlserver sqlite3; do \ + echo "$adapter:" >> ./config/database.yml; \ + echo " adapter: $adapter" >> ./config/database.yml; \ + done; \ + && bundle exec rake redmine:plugins:assets RAILS_ENV=production \ + && rm ./config/database.yml \ && chmod +x /pre-entrypoint.sh \ # setting ENTRYPOINT destroys CMD so replace the entrypoint script and call it later \ # (see bottom note in https://docs.docker.com/engine/reference/builder/#entrypoint) \ diff --git a/pre-entrypoint.sh b/pre-entrypoint.sh index 6e91588..d0b71cb 100644 --- a/pre-entrypoint.sh +++ b/pre-entrypoint.sh @@ -8,9 +8,6 @@ crontab /etc/cron.d/redmine service cron start -# For hourglass plugin -bundle exec rake redmine:plugins:assets RAILS_ENV=production - set -- /orig-entrypoint.sh "$@" echo Executing original Redmine "$@" exec "$@" \ No newline at end of file