Skip to content

Commit

Permalink
Install libvips in alpine container and github action
Browse files Browse the repository at this point in the history
  • Loading branch information
starswan committed Nov 19, 2024
1 parent f9ee68d commit 65639bc
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .github/actions/prepare-app-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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* ./
Expand Down Expand Up @@ -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/
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -805,6 +804,7 @@ DEPENDENCIES
factory_bot_rails
faker
fastimage
ffi (< 1.17)
friendly_id
front_matter_parser
geocoder
Expand Down Expand Up @@ -895,4 +895,4 @@ RUBY VERSION
ruby 3.3.5p100

BUNDLED WITH
2.3.5
2.5.23

0 comments on commit 65639bc

Please sign in to comment.