diff --git a/.circleci/docker.yml b/.circleci/docker.yml new file mode 100644 index 00000000..5d9a5804 --- /dev/null +++ b/.circleci/docker.yml @@ -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 diff --git a/.circleci/local_config.yml b/.circleci/local_config.yml new file mode 100644 index 00000000..e9c7f207 --- /dev/null +++ b/.circleci/local_config.yml @@ -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 diff --git a/.ruby-version b/.ruby-version index a0891f56..47b322c9 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.4 +3.4.1 diff --git a/Gemfile b/Gemfile index 0a30ff39..f4505e9b 100644 --- a/Gemfile +++ b/Gemfile @@ -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' diff --git a/Gemfile.lock b/Gemfile.lock index 144f3b3d..6778fe11 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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 diff --git a/docker/Dockerfile.dev b/docker/Dockerfile.dev index 37b04015..710ad7d2 100644 --- a/docker/Dockerfile.dev +++ b/docker/Dockerfile.dev @@ -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 ../. ./