Update Ruby to 3.4.1 and replace alpine docker image with bookworm

This commit is contained in:
Eugene Burmakin 2025-02-05 18:56:06 +01:00
parent 1a67878aaf
commit 1df5d514e1
6 changed files with 86 additions and 16 deletions

34
.circleci/docker.yml Normal file
View file

@ -0,0 +1,34 @@
version: 2.1
jobs:
build-and-push:
docker:
- image: cimg/base:stable
steps:
- checkout
- setup_remote_docker
- run:
name: Login to DockerHub
command: |
echo "Attempting to login to DockerHub..."
echo "$DOCKERHUB_TOKEN" | sudo docker login -u "$DOCKERHUB_USERNAME" --password-stdin
- run:
name: Build and push Docker images
command: |
# Get the short SHA or use 'latest' as fallback
SHORT_SHA=${CIRCLE_SHA1:-rc1}
sudo docker buildx create --use
sudo docker buildx build \
--platform linux/amd64 \
-t freikin/dawarich:${SHORT_SHA} \
-t freikin/dawarich:rc \
-f docker/Dockerfile.dev \
--push .
workflows:
version: 2
build-and-push:
jobs:
- build-and-push:
context: dockerhub

View file

@ -0,0 +1,32 @@
version: 2
jobs:
build-and-push:
docker:
- image: cimg/base:stable
steps:
- checkout
- setup_remote_docker
- run:
name: Login to DockerHub
command: |
echo "Attempting to login to DockerHub..."
echo "$DOCKERHUB_TOKEN" | sudo docker login -u "$DOCKERHUB_USERNAME" --password-stdin
- run:
name: Build and push Docker images
command: |
# Get the short SHA or use 'latest' as fallback
SHORT_SHA=${CIRCLE_SHA1:-rc1}
sudo docker buildx create --use
sudo docker buildx build \
--platform linux/amd64 \
-t freikin/dawarich:${SHORT_SHA} \
-t freikin/dawarich:rc \
-f docker/Dockerfile.dev \
--push .
workflows:
version: 2
build-and-push:
jobs:
- build-and-push:
context: dockerhub

View file

@ -1 +1 @@
3.3.4
3.4.1

View file

@ -24,6 +24,7 @@ gem 'puma'
gem 'pundit'
gem 'rails', '~> 8.0'
gem 'racc', '~> 1.8', '>= 1.8.1' # Nokogiri dependency
gem 'nokogiri', '1.18.1'
gem 'rgeo'
gem 'rswag-api'
gem 'rswag-ui'

View file

@ -223,18 +223,18 @@ GEM
net-smtp (0.5.0)
net-protocol
nio4r (2.7.4)
nokogiri (1.18.2)
nokogiri (1.18.1)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.18.2-aarch64-linux-gnu)
nokogiri (1.18.1-aarch64-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.2-arm-linux-gnu)
nokogiri (1.18.1-arm-linux-gnu)
racc (~> 1.4)
nokogiri (1.18.2-arm64-darwin)
nokogiri (1.18.1-arm64-darwin)
racc (~> 1.4)
nokogiri (1.18.2-x86_64-darwin)
nokogiri (1.18.1-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.18.2-x86_64-linux-gnu)
nokogiri (1.18.1-x86_64-linux-gnu)
racc (~> 1.4)
oj (3.16.9)
bigdecimal (>= 3.0)
@ -475,6 +475,7 @@ DEPENDENCIES
importmap-rails
kaminari
lograge
nokogiri (= 1.18.1)
oj
pg
prometheus_exporter
@ -507,7 +508,7 @@ DEPENDENCIES
webmock
RUBY VERSION
ruby 3.3.4p94
ruby 3.4.1p0
BUNDLED WITH
2.5.21

View file

@ -1,4 +1,4 @@
FROM ruby:3.3.4-alpine
FROM ruby:3.4.1-bookworm
ENV APP_PATH=/var/app
ENV BUNDLE_VERSION=2.5.21
@ -8,20 +8,22 @@ ENV RAILS_PORT=3000
ENV RAILS_ENV=development
# Install dependencies for application
RUN apk -U add --no-cache \
build-base \
RUN apt-get update && apt-get install -y \
build-essential \
git \
postgresql-dev \
postgresql-client \
libpq-dev \
libxml2-dev \
libxslt-dev \
nodejs \
yarn \
npm \
imagemagick \
tzdata \
less \
yaml-dev \
gcompat \
libyaml-dev \
&& npm install -g yarn \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p $APP_PATH
# Update gem system and install bundler
@ -36,7 +38,7 @@ COPY ../Gemfile ../Gemfile.lock ../.ruby-version ../vendor ./
# Install all gems into the image
RUN bundle config set --local path 'vendor/bundle' \
&& bundle install --jobs 4 --retry 3 \
&& rm -rf vendor/bundle/ruby/3.3.0/cache/*.gem
&& rm -rf vendor/bundle/ruby/3.4.0/cache/*.gem
# Copy the rest of the application
COPY ../. ./