From c8359e78ed1087f309b3f18a73ba8dffa4c6ea29 Mon Sep 17 00:00:00 2001 From: Venkata Challa Date: Fri, 31 May 2024 11:36:29 +0100 Subject: [PATCH 1/8] Service Onboard to Logit.io --- terraform/aks/application.tf | 2 ++ terraform/aks/config/qa.tfvars.json | 3 ++- terraform/aks/config/review.tfvars.json | 3 ++- terraform/aks/config/staging.tfvars.json | 3 ++- terraform/aks/variables.tf | 4 +++- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/terraform/aks/application.tf b/terraform/aks/application.tf index b73746cd..7d925a5a 100644 --- a/terraform/aks/application.tf +++ b/terraform/aks/application.tf @@ -19,6 +19,7 @@ module "web_application" { probe_path = var.probe_path web_external_hostnames = var.gov_uk_host_names + enable_logit = var.enable_logit } module "application_configuration" { @@ -54,4 +55,5 @@ module "worker_application" { replicas = 1 command = ["/bin/sh", "-c", "./bin/worker-startup.sh"] probe_command = ["pgrep", "-f", "sidekiq"] + enable_logit = var.enable_logit } diff --git a/terraform/aks/config/qa.tfvars.json b/terraform/aks/config/qa.tfvars.json index 8f2bd01f..45490ddb 100644 --- a/terraform/aks/config/qa.tfvars.json +++ b/terraform/aks/config/qa.tfvars.json @@ -13,5 +13,6 @@ "gov_uk_host_names": [ "qa.get-a-teacher-relocation-payment.education.gov.uk" ], - "azure_enable_backup_storage": false + "azure_enable_backup_storage": false, + "enable_logit": true } diff --git a/terraform/aks/config/review.tfvars.json b/terraform/aks/config/review.tfvars.json index 35d7d4b8..cff0fadb 100644 --- a/terraform/aks/config/review.tfvars.json +++ b/terraform/aks/config/review.tfvars.json @@ -10,5 +10,6 @@ "enable_monitoring": false, "startup_command": ["/bin/sh", "-c", "./bin/app-startup.sh"], "replicas": 1, - "memory_max": "1Gi" + "memory_max": "1Gi", + "enable_logit": true } diff --git a/terraform/aks/config/staging.tfvars.json b/terraform/aks/config/staging.tfvars.json index fdd9fc56..9c052b4e 100644 --- a/terraform/aks/config/staging.tfvars.json +++ b/terraform/aks/config/staging.tfvars.json @@ -13,5 +13,6 @@ "gov_uk_host_names": [ "staging.get-a-teacher-relocation-payment.education.gov.uk" ], - "azure_enable_backup_storage": false + "azure_enable_backup_storage": false, + "enable_logit": true } diff --git a/terraform/aks/variables.tf b/terraform/aks/variables.tf index a3dca977..51c3d4bf 100644 --- a/terraform/aks/variables.tf +++ b/terraform/aks/variables.tf @@ -40,6 +40,8 @@ variable "statuscake_alerts" { default = {} } +variable "enable_logit" { default = false } + locals { service_name = "teacher-relocation-payment" version = "1.9.7" @@ -55,7 +57,7 @@ locals { app_env_values = merge( local.app_config, - # sslmode not defined in database.yml? + # sslmode not defined in database.yml? { DB_SSLMODE = local.postgres_ssl_mode } ) From 552d9d0a4aa5da47b7101af96cdeccb7ee234d9e Mon Sep 17 00:00:00 2001 From: Venkata Challa Date: Fri, 31 May 2024 12:22:18 +0100 Subject: [PATCH 2/8] Updated version for nokogiri and rexml --- Gemfile | 4 ++++ Gemfile.lock | 18 +++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index a7c8373c..c6f67f41 100644 --- a/Gemfile +++ b/Gemfile @@ -93,3 +93,7 @@ gem "importmap-rails", "~> 1.2" gem "propshaft", "~> 0.8.0" gem "rubyXL", "~> 3.4" + +gem "nokogiri", ">= 1.16.5" + +gem "rexml", ">= 3.2.7" diff --git a/Gemfile.lock b/Gemfile.lock index 1faa5d1d..be35973c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -43,7 +43,7 @@ GEM activestorage (= 7.1.2) activesupport (= 7.1.2) globalid (>= 0.6.0) - nokogiri (>= 1.8.5) + nokogiri (>= 1.16.5) actionview (7.1.2) activesupport (= 7.1.2) builder (~> 3.1) @@ -259,7 +259,7 @@ GEM matrix (0.4.2) method_source (1.0.0) mini_mime (1.1.5) - mini_portile2 (2.8.5) + mini_portile2 (2.8.6) minitest (5.22.3) msgpack (1.7.2) multi_xml (0.6.0) @@ -274,7 +274,7 @@ GEM net-smtp (0.4.0) net-protocol nio4r (2.6.1) - nokogiri (1.16.3) + nokogiri (1.16.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) notifications-ruby-client (5.4.0) @@ -321,7 +321,7 @@ GEM puma (6.4.2) nio4r (~> 2.0) raabro (1.4.0) - racc (1.7.3) + racc (1.8.0) rack (2.2.8.1) rack-protection (3.1.0) rack (~> 2.2, >= 2.2.4) @@ -374,7 +374,8 @@ GEM responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) - rexml (3.2.6) + rexml (3.2.8) + strscan (>= 3.0.9) rolify (6.0.1) rspec-core (3.12.2) rspec-support (~> 3.12.0) @@ -470,6 +471,7 @@ GEM hashie version_gem (~> 1.1, >= 1.1.1) stringio (3.1.0) + strscan (3.1.0) thor (1.3.1) timeout (0.4.1) tzinfo (2.0.6) @@ -528,6 +530,7 @@ DEPENDENCIES jbuilder launchy mail-notify (~> 1.2) + nokogiri (>= 1.16.5) notifications-ruby-client okcomputer omniauth-azure-activedirectory-v2 @@ -538,6 +541,7 @@ DEPENDENCIES pry-byebug puma (>= 6.4.2, < 7) rails (~> 7.1) + rexml (>= 3.2.7) rolify rspec-rails rubocop-govuk @@ -556,7 +560,7 @@ DEPENDENCIES web-console RUBY VERSION - ruby 3.2.2p53 + ruby 3.2.3p157 BUNDLED WITH - 2.4.21 + 2.4.19 From c1f3900c55efb5fe8f2a150a859f62d8595db397 Mon Sep 17 00:00:00 2001 From: Venkata Challa Date: Fri, 31 May 2024 13:09:13 +0100 Subject: [PATCH 3/8] wip --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c04ad0c9..09bff1a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,12 +10,12 @@ RUN apk add --update --no-cache tzdata && \ COPY .tool-versions Gemfile Gemfile.lock ./ -RUN apk add --update --no-cache --virtual build-dependances \ +RUN apk add --update --no-cache --virtual build-dependencies \ postgresql-dev build-base && \ apk add --update --no-cache libpq yarn yaml-dev && \ bundle install --without=test development --jobs=4 && \ rm -rf /usr/local/bundle/cache && \ - apk del build-dependances + apk del build-dependencies COPY package.json yarn.lock ./ RUN yarn install --frozen-lockfile && \ From 544ecbb739d94c2480cc1bfec847e51ec9e52155 Mon Sep 17 00:00:00 2001 From: Venkata Challa Date: Fri, 31 May 2024 13:14:32 +0100 Subject: [PATCH 4/8] wip --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 09bff1a9..aaad2cff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,12 +10,12 @@ RUN apk add --update --no-cache tzdata && \ COPY .tool-versions Gemfile Gemfile.lock ./ -RUN apk add --update --no-cache --virtual build-dependencies \ +RUN apk add --update --no-cache --virtual .build-deps \ postgresql-dev build-base && \ apk add --update --no-cache libpq yarn yaml-dev && \ bundle install --without=test development --jobs=4 && \ rm -rf /usr/local/bundle/cache && \ - apk del build-dependencies + apk del .build-deps COPY package.json yarn.lock ./ RUN yarn install --frozen-lockfile && \ From b69cd682d26e650d4a53d66d0db84725f0c7e612 Mon Sep 17 00:00:00 2001 From: Venkata Challa Date: Fri, 31 May 2024 13:19:02 +0100 Subject: [PATCH 5/8] wip --- Dockerfile | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index aaad2cff..f9e76c58 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,18 +8,27 @@ RUN apk add --update --no-cache tzdata && \ cp /usr/share/zoneinfo/Europe/London /etc/localtime && \ echo "Europe/London" > /etc/timezone +# Install build dependencies +RUN apk add --update --no-cache --virtual .build-deps \ + postgresql-dev build-base \ + && apk add --update --no-cache libpq yarn yaml-dev + +# Copy Gemfile and Gemfile.lock before bundle install COPY .tool-versions Gemfile Gemfile.lock ./ -RUN apk add --update --no-cache --virtual .build-deps \ - postgresql-dev build-base && \ - apk add --update --no-cache libpq yarn yaml-dev && \ - bundle install --without=test development --jobs=4 && \ - rm -rf /usr/local/bundle/cache && \ - apk del .build-deps +# Install gems +RUN bundle install --without=test development --jobs=4 + +# Clean up bundler cache +RUN rm -rf /usr/local/bundle/cache + +# Remove build dependencies +RUN apk del .build-deps +# Copy package.json and yarn.lock and install yarn packages COPY package.json yarn.lock ./ RUN yarn install --frozen-lockfile && \ - yarn cache clean + yarn cache clean COPY . . @@ -35,10 +44,12 @@ ENV GOVUK_NOTIFY_API_KEY=$GOVUK_NOTIFY_API_KEY ARG GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID ENV GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID=$GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID +# Precompile assets and clean up RUN RAILS_ENV=production \ SECRET_KEY_BASE=required_but_does_not_matter_for_assets \ bundle exec rake assets:precompile && \ rm -rf node_modules tmp && \ apk del yarn nodejs +# Set the default command CMD ./bin/app-startup.sh From 4acc894f2e6af4f8c436fcfa9178561d3f147603 Mon Sep 17 00:00:00 2001 From: Venkata Challa Date: Fri, 31 May 2024 13:22:40 +0100 Subject: [PATCH 6/8] wip --- Dockerfile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index f9e76c58..a9f6c546 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,20 +4,23 @@ ENV APP_HOME /app RUN mkdir $APP_HOME WORKDIR $APP_HOME +# Set timezone RUN apk add --update --no-cache tzdata && \ cp /usr/share/zoneinfo/Europe/London /etc/localtime && \ echo "Europe/London" > /etc/timezone # Install build dependencies RUN apk add --update --no-cache --virtual .build-deps \ - postgresql-dev build-base \ - && apk add --update --no-cache libpq yarn yaml-dev + postgresql-dev build-base + +# Install runtime dependencies +RUN apk add --update --no-cache libpq yarn yaml-dev # Copy Gemfile and Gemfile.lock before bundle install COPY .tool-versions Gemfile Gemfile.lock ./ -# Install gems -RUN bundle install --without=test development --jobs=4 +# Install gems with verbose logging +RUN bundle install --without=test development --jobs=4 --verbose # Clean up bundler cache RUN rm -rf /usr/local/bundle/cache @@ -27,11 +30,13 @@ RUN apk del .build-deps # Copy package.json and yarn.lock and install yarn packages COPY package.json yarn.lock ./ -RUN yarn install --frozen-lockfile && \ +RUN yarn install --frozen-lockfile && \ yarn cache clean +# Copy application code COPY . . +# Set environment variables RUN echo export PATH=/usr/local/bin:\$PATH > /root/.ashrc ENV ENV="/root/.ashrc" From d7ee30a43afeec4dd981b2f83b3765f5b96aeb11 Mon Sep 17 00:00:00 2001 From: Venkata Challa Date: Fri, 31 May 2024 13:36:28 +0100 Subject: [PATCH 7/8] wip --- Gemfile.lock | 389 ++++++++++++++++++++++++--------------------------- 1 file changed, 184 insertions(+), 205 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index be35973c..13f879cc 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,35 +1,35 @@ GEM remote: https://rubygems.org/ specs: - actioncable (7.1.2) - actionpack (= 7.1.2) - activesupport (= 7.1.2) + actioncable (7.1.3.3) + actionpack (= 7.1.3.3) + activesupport (= 7.1.3.3) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.2) - actionpack (= 7.1.2) - activejob (= 7.1.2) - activerecord (= 7.1.2) - activestorage (= 7.1.2) - activesupport (= 7.1.2) + actionmailbox (7.1.3.3) + actionpack (= 7.1.3.3) + activejob (= 7.1.3.3) + activerecord (= 7.1.3.3) + activestorage (= 7.1.3.3) + activesupport (= 7.1.3.3) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.1.2) - actionpack (= 7.1.2) - actionview (= 7.1.2) - activejob (= 7.1.2) - activesupport (= 7.1.2) + actionmailer (7.1.3.3) + actionpack (= 7.1.3.3) + actionview (= 7.1.3.3) + activejob (= 7.1.3.3) + activesupport (= 7.1.3.3) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.2) - actionpack (7.1.2) - actionview (= 7.1.2) - activesupport (= 7.1.2) + actionpack (7.1.3.3) + actionview (= 7.1.3.3) + activesupport (= 7.1.3.3) nokogiri (>= 1.8.5) racc rack (>= 2.2.4) @@ -37,35 +37,35 @@ GEM rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.2) - actionpack (= 7.1.2) - activerecord (= 7.1.2) - activestorage (= 7.1.2) - activesupport (= 7.1.2) + actiontext (7.1.3.3) + actionpack (= 7.1.3.3) + activerecord (= 7.1.3.3) + activestorage (= 7.1.3.3) + activesupport (= 7.1.3.3) globalid (>= 0.6.0) - nokogiri (>= 1.16.5) - actionview (7.1.2) - activesupport (= 7.1.2) + nokogiri (>= 1.8.5) + actionview (7.1.3.3) + activesupport (= 7.1.3.3) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.1.2) - activesupport (= 7.1.2) + activejob (7.1.3.3) + activesupport (= 7.1.3.3) globalid (>= 0.3.6) - activemodel (7.1.2) - activesupport (= 7.1.2) - activerecord (7.1.2) - activemodel (= 7.1.2) - activesupport (= 7.1.2) + activemodel (7.1.3.3) + activesupport (= 7.1.3.3) + activerecord (7.1.3.3) + activemodel (= 7.1.3.3) + activesupport (= 7.1.3.3) timeout (>= 0.4.0) - activestorage (7.1.2) - actionpack (= 7.1.2) - activejob (= 7.1.2) - activerecord (= 7.1.2) - activesupport (= 7.1.2) + activestorage (7.1.3.3) + actionpack (= 7.1.3.3) + activejob (= 7.1.3.3) + activerecord (= 7.1.3.3) + activesupport (= 7.1.3.3) marcel (~> 1.0) - activesupport (7.1.2) + activesupport (7.1.3.3) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -75,141 +75,111 @@ GEM minitest (>= 5.1) mutex_m tzinfo (~> 2.0) - addressable (2.8.4) + addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) annotate (3.2.0) activerecord (>= 3.2, < 8.0) rake (>= 10.4, < 14.0) ast (2.4.2) - audited (5.4.2) - activerecord (>= 5.0, < 7.2) - request_store (~> 1.2) + audited (5.6.0) + activerecord (>= 5.2, < 7.2) + activesupport (>= 5.2, < 7.2) base64 (0.2.0) - bcrypt (3.1.19) - bigdecimal (3.1.7) + bcrypt (3.1.20) + bigdecimal (3.1.8) bindex (0.8.1) - binding_of_caller (1.0.0) - debug_inspector (>= 0.0.1) - bootsnap (1.17.0) + binding_of_caller (1.0.1) + debug_inspector (>= 1.2.0) + bootsnap (1.18.3) msgpack (~> 1.2) - brakeman (6.1.0) - brow (0.4.1) + brakeman (6.1.2) + racc builder (3.2.4) bundler-audit (0.9.1) bundler (>= 1.2.0, < 3) thor (~> 1.0) byebug (11.1.3) - capybara (3.39.2) + capybara (3.40.0) addressable matrix mini_mime (>= 0.1.3) - nokogiri (~> 1.8) + nokogiri (~> 1.11) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) + childprocess (5.0.0) coderay (1.1.3) - concurrent-ruby (1.2.2) - concurrent-ruby-ext (1.2.2) - concurrent-ruby (= 1.2.2) - config (5.1.0) + concurrent-ruby (1.3.1) + concurrent-ruby-ext (1.3.1) + concurrent-ruby (= 1.3.1) + config (5.5.1) deep_merge (~> 1.2, >= 1.2.1) - dry-validation (~> 1.0, >= 1.0.0) connection_pool (2.4.1) crass (1.0.6) + csv (3.3.0) dartsass-rails (0.5.0) railties (>= 6.0.0) sass-embedded (~> 1.63) date (3.3.4) - debug (1.9.0) + debug (1.9.2) irb (~> 1.10) reline (>= 0.3.8) - debug_inspector (1.1.0) + debug_inspector (1.2.0) deep_merge (1.2.2) - devise (4.9.3) + devise (4.9.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) - diff-lcs (1.5.0) + diff-lcs (1.5.1) docile (1.4.0) - dotenv (2.8.1) - dotenv-rails (2.8.1) - dotenv (= 2.8.1) - railties (>= 3.2) + dotenv (3.1.2) + dotenv-rails (3.1.2) + dotenv (= 3.1.2) + railties (>= 6.1) drb (2.2.1) - dry-configurable (1.1.0) - dry-core (~> 1.0, < 2) - zeitwerk (~> 2.6) - dry-core (1.0.1) - concurrent-ruby (~> 1.0) - zeitwerk (~> 2.6) - dry-inflector (1.0.0) - dry-initializer (3.1.1) - dry-logic (1.5.0) - concurrent-ruby (~> 1.0) - dry-core (~> 1.0, < 2) - zeitwerk (~> 2.6) - dry-schema (1.13.3) - concurrent-ruby (~> 1.0) - dry-configurable (~> 1.0, >= 1.0.1) - dry-core (~> 1.0, < 2) - dry-initializer (~> 3.0) - dry-logic (>= 1.4, < 2) - dry-types (>= 1.7, < 2) - zeitwerk (~> 2.6) - dry-types (1.7.1) - concurrent-ruby (~> 1.0) - dry-core (~> 1.0) - dry-inflector (~> 1.0) - dry-logic (~> 1.4) - zeitwerk (~> 2.6) - dry-validation (1.10.0) - concurrent-ruby (~> 1.0) - dry-core (~> 1.0, < 2) - dry-initializer (~> 3.0) - dry-schema (>= 1.12, < 2) - zeitwerk (~> 2.6) erubi (1.12.0) - et-orbi (1.2.7) + et-orbi (1.2.11) tzinfo - factory_bot (6.4.2) + factory_bot (6.4.6) activesupport (>= 5.0.0) - factory_bot_rails (6.4.2) + factory_bot_rails (6.4.3) factory_bot (~> 6.4) railties (>= 5.0.0) - faker (3.2.0) + faker (3.4.1) i18n (>= 1.8.11, < 2) - faraday (2.7.11) - base64 - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) - faraday-net_http (3.0.2) - flipper (1.0.0) - brow (~> 0.4.1) + faraday (2.9.0) + faraday-net_http (>= 2.0, < 3.2) + faraday-net_http (3.1.0) + net-http + flipper (1.3.0) concurrent-ruby (< 2) - flipper-active_record (1.0.0) + flipper-active_record (1.3.0) activerecord (>= 4.2, < 8) - flipper (~> 1.0.0) - flipper-ui (1.0.0) + flipper (~> 1.3.0) + flipper-ui (1.3.0) erubi (>= 1.0.0, < 2.0.0) - flipper (~> 1.0.0) + flipper (~> 1.3.0) rack (>= 1.4, < 4) - rack-protection (>= 1.5.3, <= 4.0.0) + rack-protection (>= 1.5.3, < 5.0.0) + rack-session (>= 1.0.2, < 3.0.0) sanitize (< 7) - foreman (0.87.2) - fugit (1.9.0) - et-orbi (~> 1, >= 1.2.7) + foreman (0.88.1) + fugit (1.11.0) + et-orbi (~> 1, >= 1.2.11) raabro (~> 1.4) globalid (1.2.1) activesupport (>= 6.1) - google-protobuf (3.24.4) + google-protobuf (4.27.0) + bigdecimal + rake (>= 13) govuk-components (4.1.2) html-attributes-utils (~> 1.0.0, >= 1.0.0) pagy (~> 6.0) view_component (>= 3.3, < 3.7) - govuk_design_system_formbuilder (4.1.1) + govuk_design_system_formbuilder (5.4.0) actionview (>= 6.1) activemodel (>= 6.1) activesupport (>= 6.1) @@ -217,29 +187,32 @@ GEM hashie (5.0.0) html-attributes-utils (1.0.2) activesupport (>= 6.1.4.4) - httparty (0.21.0) + httparty (0.22.0) + csv mini_mime (>= 1.0.0) multi_xml (>= 0.5.2) - i18n (1.14.4) + i18n (1.14.5) concurrent-ruby (~> 1.0) importmap-rails (1.2.3) actionpack (>= 6.0.0) activesupport (>= 6.0.0) railties (>= 6.0.0) - invisible_captcha (2.1.0) + invisible_captcha (2.3.0) rails (>= 5.2) io-console (0.7.2) - irb (1.12.0) - rdoc + irb (1.13.1) + rdoc (>= 4.0.0) reline (>= 0.4.2) - jbuilder (2.11.5) + jbuilder (2.12.0) actionview (>= 5.0.0) activesupport (>= 5.0.0) - json (2.6.3) - jwt (2.7.1) + json (2.7.2) + jwt (2.8.1) + base64 language_server-protocol (3.17.0.3) - launchy (2.5.2) + launchy (3.0.1) addressable (~> 2.8) + childprocess (~> 5.0) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -255,25 +228,28 @@ GEM activesupport (>= 5.2.4.6) notifications-ruby-client (~> 5.1) rack (>= 2.1.4.1) - marcel (1.0.2) + marcel (1.0.4) matrix (0.4.2) - method_source (1.0.0) + method_source (1.1.0) mini_mime (1.1.5) mini_portile2 (2.8.6) - minitest (5.22.3) + minitest (5.23.1) msgpack (1.7.2) - multi_xml (0.6.0) + multi_xml (0.7.1) + bigdecimal (~> 3.1) mutex_m (0.2.0) - net-imap (0.4.6) + net-http (0.4.1) + uri + net-imap (0.4.11) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.2) timeout - net-smtp (0.4.0) + net-smtp (0.5.0) net-protocol - nio4r (2.6.1) + nio4r (2.7.3) nokogiri (1.16.5) mini_portile2 (~> 2.8.2) racc (~> 1.4) @@ -287,7 +263,7 @@ GEM snaky_hash (~> 2.0) version_gem (~> 1.1) okcomputer (1.18.5) - omniauth (2.1.1) + omniauth (2.1.2) hashie (>= 3.4.6) rack (>= 2.2.3) rack-protection @@ -298,11 +274,11 @@ GEM omniauth (~> 2.0) orm_adapter (0.5.0) pagy (6.5.0) - parallel (1.23.0) - parser (3.2.2.3) + parallel (1.24.0) + parser (3.3.2.0) ast (~> 2.4.1) racc - pg (1.5.4) + pg (1.5.6) phonelib (0.8.8) propshaft (0.8.0) actionpack (>= 7.0.0) @@ -317,13 +293,14 @@ GEM pry (>= 0.13, < 0.15) psych (5.1.2) stringio - public_suffix (5.0.1) + public_suffix (5.0.5) puma (6.4.2) nio4r (~> 2.0) raabro (1.4.0) racc (1.8.0) - rack (2.2.8.1) - rack-protection (3.1.0) + rack (2.2.9) + rack-protection (3.2.0) + base64 (>= 0.1.0) rack (~> 2.2, >= 2.2.4) rack-session (1.0.2) rack (< 3) @@ -332,20 +309,20 @@ GEM rackup (1.0.0) rack (< 3) webrick - rails (7.1.2) - actioncable (= 7.1.2) - actionmailbox (= 7.1.2) - actionmailer (= 7.1.2) - actionpack (= 7.1.2) - actiontext (= 7.1.2) - actionview (= 7.1.2) - activejob (= 7.1.2) - activemodel (= 7.1.2) - activerecord (= 7.1.2) - activestorage (= 7.1.2) - activesupport (= 7.1.2) + rails (7.1.3.3) + actioncable (= 7.1.3.3) + actionmailbox (= 7.1.3.3) + actionmailer (= 7.1.3.3) + actionpack (= 7.1.3.3) + actiontext (= 7.1.3.3) + actionview (= 7.1.3.3) + activejob (= 7.1.3.3) + activemodel (= 7.1.3.3) + activerecord (= 7.1.3.3) + activestorage (= 7.1.3.3) + activesupport (= 7.1.3.3) bundler (>= 1.15.0) - railties (= 7.1.2) + railties (= 7.1.3.3) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -353,102 +330,103 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.1.2) - actionpack (= 7.1.2) - activesupport (= 7.1.2) + railties (7.1.3.3) + actionpack (= 7.1.3.3) + activesupport (= 7.1.3.3) irb rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) rainbow (3.1.1) - rake (13.1.0) - rdoc (6.6.2) + rake (13.2.1) + rdoc (6.7.0) psych (>= 4.0.0) redis (4.8.1) - regexp_parser (2.8.1) - reline (0.4.3) + regexp_parser (2.9.2) + reline (0.5.8) io-console (~> 0.5) - request_store (1.5.1) - rack (>= 1.4) responders (3.1.1) actionpack (>= 5.2) railties (>= 5.2) rexml (3.2.8) strscan (>= 3.0.9) rolify (6.0.1) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.0) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (6.1.0) + rspec-support (~> 3.13.0) + rspec-rails (6.1.2) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) - rspec-core (~> 3.12) - rspec-expectations (~> 3.12) - rspec-mocks (~> 3.12) - rspec-support (~> 3.12) - rspec-support (3.12.1) - rubocop (1.55.0) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.1) + rubocop (1.63.5) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.3) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.29.0) - parser (>= 3.2.1.0) - rubocop-capybara (2.18.0) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) + rubocop-capybara (2.20.0) + rubocop (~> 1.41) + rubocop-factory_bot (2.25.1) rubocop (~> 1.41) - rubocop-factory_bot (2.23.1) - rubocop (~> 1.33) - rubocop-govuk (4.12.0) - rubocop (= 1.55.0) - rubocop-ast (= 1.29.0) - rubocop-rails (= 2.20.2) + rubocop-govuk (4.17.1) + rubocop (= 1.63.5) + rubocop-ast (= 1.31.3) + rubocop-rails (= 2.25.0) rubocop-rake (= 0.6.0) - rubocop-rspec (= 2.22.0) - rubocop-performance (1.19.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - rubocop-rails (2.20.2) + rubocop-rspec (= 2.29.2) + rubocop-performance (1.21.0) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.25.0) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (2.22.0) - rubocop (~> 1.33) + rubocop-rspec (2.29.2) + rubocop (~> 1.40) rubocop-capybara (~> 2.17) rubocop-factory_bot (~> 2.22) + rubocop-rspec_rails (~> 2.28) + rubocop-rspec_rails (2.28.3) + rubocop (~> 1.40) ruby-progressbar (1.13.0) - ruby2_keywords (0.0.5) - rubyXL (3.4.25) + rubyXL (3.4.27) nokogiri (>= 1.10.8) rubyzip (>= 1.3.0) rubyzip (2.3.2) sanitize (6.1.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) - sass-embedded (1.69.3) - google-protobuf (~> 3.23) - rake (>= 13.0.0) - scenic (1.7.0) + sass-embedded (1.77.4) + google-protobuf (>= 3.25, < 5.0) + rake (>= 13) + scenic (1.8.0) activerecord (>= 4.0.0) railties (>= 4.0.0) - sentry-rails (5.17.1) + sentry-rails (5.17.3) railties (>= 5.0) - sentry-ruby (~> 5.17.1) - sentry-ruby (5.17.1) + sentry-ruby (~> 5.17.3) + sentry-ruby (5.17.3) bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) shoulda-matchers (6.2.0) @@ -477,8 +455,9 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) uk_postcode (2.1.8) - unicode-display_width (2.4.2) - version_gem (1.1.3) + unicode-display_width (2.5.0) + uri (0.13.0) + version_gem (1.1.4) view_component (3.6.0) activesupport (>= 5.2.0, < 8.0) concurrent-ruby (~> 1.0) @@ -496,7 +475,7 @@ GEM websocket-extensions (0.1.5) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.13) + zeitwerk (2.6.15) PLATFORMS ruby From a053f63dc62517c62993af22f05a31095c1eaad9 Mon Sep 17 00:00:00 2001 From: Venkata Challa Date: Fri, 31 May 2024 13:40:54 +0100 Subject: [PATCH 8/8] wip --- Dockerfile | 32 ++++++++------------------------ 1 file changed, 8 insertions(+), 24 deletions(-) diff --git a/Dockerfile b/Dockerfile index a9f6c546..c04ad0c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,39 +4,25 @@ ENV APP_HOME /app RUN mkdir $APP_HOME WORKDIR $APP_HOME -# Set timezone RUN apk add --update --no-cache tzdata && \ cp /usr/share/zoneinfo/Europe/London /etc/localtime && \ echo "Europe/London" > /etc/timezone -# Install build dependencies -RUN apk add --update --no-cache --virtual .build-deps \ - postgresql-dev build-base - -# Install runtime dependencies -RUN apk add --update --no-cache libpq yarn yaml-dev - -# Copy Gemfile and Gemfile.lock before bundle install COPY .tool-versions Gemfile Gemfile.lock ./ -# Install gems with verbose logging -RUN bundle install --without=test development --jobs=4 --verbose - -# Clean up bundler cache -RUN rm -rf /usr/local/bundle/cache - -# Remove build dependencies -RUN apk del .build-deps +RUN apk add --update --no-cache --virtual build-dependances \ + postgresql-dev build-base && \ + apk add --update --no-cache libpq yarn yaml-dev && \ + bundle install --without=test development --jobs=4 && \ + rm -rf /usr/local/bundle/cache && \ + apk del build-dependances -# Copy package.json and yarn.lock and install yarn packages COPY package.json yarn.lock ./ -RUN yarn install --frozen-lockfile && \ - yarn cache clean +RUN yarn install --frozen-lockfile && \ + yarn cache clean -# Copy application code COPY . . -# Set environment variables RUN echo export PATH=/usr/local/bin:\$PATH > /root/.ashrc ENV ENV="/root/.ashrc" @@ -49,12 +35,10 @@ ENV GOVUK_NOTIFY_API_KEY=$GOVUK_NOTIFY_API_KEY ARG GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID ENV GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID=$GOVUK_NOTIFY_GENERIC_EMAIL_TEMPLATE_ID -# Precompile assets and clean up RUN RAILS_ENV=production \ SECRET_KEY_BASE=required_but_does_not_matter_for_assets \ bundle exec rake assets:precompile && \ rm -rf node_modules tmp && \ apk del yarn nodejs -# Set the default command CMD ./bin/app-startup.sh