From 897750ba1eb67c7c0ef6135e80e2708ca2d4536b Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Thu, 2 May 2024 10:01:31 +0300 Subject: [PATCH] fix build --- Dockerfile | 5 +++-- Gemfile | 2 +- Gemfile.lock | 8 +++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index c2a44063..931c99fc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -36,14 +36,15 @@ FROM ruby:3.3.1-alpine3.18 as app ENV RAILS_ENV=production ENV BUNDLE_WITHOUT="development:test" +ENV LD_PRELOAD=/lib/libgcompat.so.0 WORKDIR /app -RUN apk add --no-cache sqlite-dev libpq-dev mariadb-dev vips-dev vips-poppler poppler-utils vips-heif libc6-compat ttf-freefont && mkdir /fonts && rm /usr/share/fonts/freefont/FreeSans.otf +RUN apk add --no-cache sqlite-dev libpq-dev mariadb-dev vips-dev vips-poppler poppler-utils vips-heif gcompat ttf-freefont && mkdir /fonts && rm /usr/share/fonts/freefont/FreeSans.otf COPY ./Gemfile ./Gemfile.lock ./ -RUN apk add --no-cache build-base && bundle update --bundler && bundle install && apk del build-base && rm -rf ~/.bundle /usr/local/bundle/cache && ruby -e "puts Dir['/usr/local/bundle/**/{spec,rdoc,resources/shared,resources/collation,resources/locales}']" | xargs rm -rf +RUN apk add --no-cache build-base && bundle install && apk del build-base && rm -rf ~/.bundle /usr/local/bundle/cache && ruby -e "puts Dir['/usr/local/bundle/**/{spec,rdoc,resources/shared,resources/collation,resources/locales}']" | xargs rm -rf COPY ./bin ./bin COPY ./app ./app diff --git a/Gemfile b/Gemfile index 4709da63..1acb2a2e 100644 --- a/Gemfile +++ b/Gemfile @@ -39,7 +39,7 @@ gem 'ruby-vips' gem 'rubyXL' gem 'shakapacker' gem 'sidekiq', require: ENV.key?('REDIS_URL') -gem 'sqlite3', require: false +gem 'sqlite3', require: false, force_ruby_platform: true gem 'strip_attributes' gem 'turbo-rails' gem 'twitter_cldr', require: false diff --git a/Gemfile.lock b/Gemfile.lock index e223d32c..7bc63674 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -333,7 +333,9 @@ GEM nokogiri (1.16.4) mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.16.4-arm64-darwin) + nokogiri (1.16.4-aarch64-linux) + racc (~> 1.4) + nokogiri (1.16.4-x86_64-linux) racc (~> 1.4) oj (3.16.3) bigdecimal (>= 3.0) @@ -529,7 +531,6 @@ GEM smart_properties (1.17.0) sqlite3 (1.7.3) mini_portile2 (~> 2.8.0) - sqlite3 (1.7.3-arm64-darwin) stringio (3.1.0) strip_attributes (1.13.0) activemodel (>= 3.0, < 8.0) @@ -573,8 +574,9 @@ GEM zeitwerk (2.6.13) PLATFORMS - arm64-darwin-22 + aarch64-linux ruby + x86_64-linux DEPENDENCIES annotate