Skip to content

Commit

Permalink
Update Ruby to 3.4.1 and replace alpine docker image with bookworm
Browse files Browse the repository at this point in the history
  • Loading branch information
Freika committed Feb 5, 2025
1 parent 1a67878 commit 1df5d51
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 16 deletions.
34 changes: 34 additions & 0 deletions .circleci/docker.yml
Original file line number Diff line number Diff line change
@@ -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
32 changes: 32 additions & 0 deletions .circleci/local_config.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.4
3.4.1
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
15 changes: 8 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -475,6 +475,7 @@ DEPENDENCIES
importmap-rails
kaminari
lograge
nokogiri (= 1.18.1)
oj
pg
prometheus_exporter
Expand Down Expand Up @@ -507,7 +508,7 @@ DEPENDENCIES
webmock

RUBY VERSION
ruby 3.3.4p94
ruby 3.4.1p0

BUNDLED WITH
2.5.21
18 changes: 10 additions & 8 deletions docker/Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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 ../. ./
Expand Down

0 comments on commit 1df5d51

Please sign in to comment.