From 9850c77c82f14a4f2355343e4e2e23ae70083c52 Mon Sep 17 00:00:00 2001 From: Chris Colvard Date: Wed, 20 Sep 2023 14:23:11 -0400 Subject: [PATCH 1/2] Remove references to webpacker webpacker:compile rake task is unnecessary in Dockerfile because assets:compile will automatically do the same work check_yarn_integrity config option no longer exists --- Dockerfile | 1 - config/environments/production.rb | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c2b634eaa6..036675e289 100644 --- a/Dockerfile +++ b/Dockerfile @@ -131,7 +131,6 @@ COPY --from=node-modules --chown=app:app /node_modules ./node_modules USER app ENV RAILS_ENV=production -RUN SECRET_KEY_BASE=$(ruby -r 'securerandom' -e 'puts SecureRandom.hex(64)') bundle exec rake webpacker:compile RUN SECRET_KEY_BASE=$(ruby -r 'securerandom' -e 'puts SecureRandom.hex(64)') bundle exec rake assets:precompile RUN cp config/controlled_vocabulary.yml.example config/controlled_vocabulary.yml diff --git a/config/environments/production.rb b/config/environments/production.rb index 3039ff56ad..b879dd37e8 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -4,7 +4,7 @@ # Settings specified here will take precedence over those in config/application.rb. # Verifies that versions and hashed value of the package contents in the project's package.json - config.webpacker.check_yarn_integrity = false + # config.webpacker.check_yarn_integrity = false # Code is not reloaded between requests. config.cache_classes = true From b2bb1f5fd162e7ec0b3208061ce31c94d4cf35cf Mon Sep 17 00:00:00 2001 From: Chris Colvard Date: Wed, 20 Sep 2023 14:50:34 -0400 Subject: [PATCH 2/2] Clean some disk space by removing unused parts from base image The docker build for production environment ran out of disk space. This github action saves about 14GB but does take 1-2 minutes to run. --- .github/workflows/podman-image.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/podman-image.yml b/.github/workflows/podman-image.yml index 19e13fd8eb..bce6d1937c 100644 --- a/.github/workflows/podman-image.yml +++ b/.github/workflows/podman-image.yml @@ -22,6 +22,21 @@ jobs: runs-on: ubuntu-latest steps: + - name: Free Disk Space (Ubuntu) + uses: jlumbroso/free-disk-space@main + with: + # this might remove tools that are actually needed, + # if set to "true" but frees about 6 GB + tool-cache: false + + # all of these default to true, but feel free to set to + # "false" if necessary for your workflow + android: true + dotnet: true + haskell: true + large-packages: false + docker-images: false + swap-storage: false - uses: actions/checkout@v3 - name: Determine DockerHub image tags id: determine_dockerhub_tags