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