From b54e90aca6eb18312d919c6d8cabd9dcb43b0d30 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 20 Aug 2025 13:03:46 +0000 Subject: [PATCH 1/2] Initial plan From 9026d989fc9b1bd6783b862dbb435efc9d2b9528 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 20 Aug 2025 13:17:05 +0000 Subject: [PATCH 2/2] Fix Docker build SECRET_KEY_BASE validation error Co-authored-by: naveed-ahmad <701567+naveed-ahmad@users.noreply.github.com> --- Dockerfile | 4 ++-- docker/README.md | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2697bf9f..07dd4e59 100644 --- a/Dockerfile +++ b/Dockerfile @@ -160,11 +160,11 @@ RUN chown app Gemfile.lock RUN mkdir -p /var/log/nginx/qul.tarteel.ai # precompile assets -RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile +RUN SECRET_KEY_BASE=$(ruby -e "require 'securerandom'; puts SecureRandom.hex(64)") ./bin/rails assets:precompile #TODO: fix this, sprockets can't find the compiled assets. # Compiling twice seems to be working -RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile +RUN SECRET_KEY_BASE=$(ruby -e "require 'securerandom'; puts SecureRandom.hex(64)") ./bin/rails assets:precompile # pg_dump RUN apt-get install -y wget diff --git a/docker/README.md b/docker/README.md index 2f5ef5d8..c5f2ad09 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,11 +1,15 @@ # QUL docker deployment -build the image: +Build the image: ``` docker build -t quranic-universal-library . ``` -run it: +Run it: ``` docker run --rm -it -p 3000:3000 --env RAILS_MASTER_KEY= quranic-universal-library -``` \ No newline at end of file +``` + +## Build Notes + +The Docker build process automatically generates a temporary SECRET_KEY_BASE during asset precompilation. This resolves Rails 7.x validation requirements for production environment secret keys during the build process. \ No newline at end of file