From 65639bc70fd692010cca2557d3d08ed57aa38852 Mon Sep 17 00:00:00 2001 From: starswan Date: Tue, 19 Nov 2024 13:46:23 +0000 Subject: [PATCH] Install libvips in alpine container and github action --- .github/actions/prepare-app-env/action.yml | 4 ++++ Dockerfile | 6 +++--- Gemfile | 2 ++ Gemfile.lock | 6 +++--- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/actions/prepare-app-env/action.yml b/.github/actions/prepare-app-env/action.yml index 6e1b13999c..dd2742173d 100644 --- a/.github/actions/prepare-app-env/action.yml +++ b/.github/actions/prepare-app-env/action.yml @@ -17,6 +17,10 @@ inputs: runs: using: composite steps: + - name: Install libvips + run: sudo apt install libvips + shell: bash + - name: Set up Ruby if: ${{ inputs.skip-ruby == 'false' }} uses: ruby/setup-ruby@v1 diff --git a/Dockerfile b/Dockerfile index d9228e3fb3..91c9d5c2ec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ # Alpine v3.19. # TODO: Regularly check in the alpine ruby "3.3.5-alpine3.19" images for its latest upgraded packages so we can remove # the hardcoded versions below when they have been updated in the alpine ruby image. -ARG PROD_PACKAGES="imagemagick libpng libjpeg libxml2 libxslt libpq tzdata shared-mime-info postgresql15 busybox=1.36.1-r19 openssl=3.1.7-r1 expat=2.6.4-r0" +ARG PROD_PACKAGES="imagemagick libpng libjpeg libxml2 libxslt libpq tzdata shared-mime-info postgresql15 busybox=1.36.1-r19 openssl=3.1.7-r1 expat=2.6.4-r0 vips-dev" FROM ruby:3.3.5-alpine3.19 AS builder @@ -13,7 +13,7 @@ ENV DEV_PACKAGES="gcc libc-dev make yarn postgresql15-dev build-base git" RUN apk add --no-cache $PROD_PACKAGES $DEV_PACKAGES RUN echo "Europe/London" > /etc/timezone && \ cp /usr/share/zoneinfo/Europe/London /etc/localtime -RUN gem install bundler:2.3.5 --no-document +RUN gem install bundler:2.5.23 --no-document COPY Gemfile* ./ @@ -58,7 +58,7 @@ ARG PROD_PACKAGES RUN apk -U upgrade && apk add --no-cache $PROD_PACKAGES RUN echo "Europe/London" > /etc/timezone && \ cp /usr/share/zoneinfo/Europe/London /etc/localtime -RUN gem install bundler:2.3.5 --no-document +RUN gem install bundler:2.5.23 --no-document COPY --from=builder /app /app COPY --from=builder /usr/local/bundle/ /usr/local/bundle/ diff --git a/Gemfile b/Gemfile index a1fc723c25..167e0151bc 100644 --- a/Gemfile +++ b/Gemfile @@ -28,6 +28,8 @@ gem "devise" gem "dfe-analytics", github: "DFE-Digital/dfe-analytics", tag: "v1.15.0" gem "factory_bot_rails" gem "faker" +# needed for deploymen ton alpinw 3.19 +gem "ffi", "< 1.17" gem "friendly_id" gem "front_matter_parser" gem "geocoder" diff --git a/Gemfile.lock b/Gemfile.lock index 6212df347e..81ae87eef3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -223,8 +223,7 @@ GEM faraday-net_http (3.3.0) net-http fastimage (2.3.1) - ffi (1.17.0-arm64-darwin) - ffi (1.17.0-x86_64-linux-gnu) + ffi (1.16.3) friendly_id (5.5.1) activerecord (>= 4.0.0) front_matter_parser (1.0.1) @@ -805,6 +804,7 @@ DEPENDENCIES factory_bot_rails faker fastimage + ffi (< 1.17) friendly_id front_matter_parser geocoder @@ -895,4 +895,4 @@ RUBY VERSION ruby 3.3.5p100 BUNDLED WITH - 2.3.5 + 2.5.23