Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .browserslistrc

This file was deleted.

8 changes: 4 additions & 4 deletions .docker/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
### app/rails config ###
########################

FROM ruby:2.7.8 AS app
FROM ruby:3.4.2 AS app

LABEL author="IdeaCrew"
LABEL author="DCHBX"

ARG NODE_MAJOR

Expand All @@ -19,8 +19,8 @@ ARG YARN_VERSION
# Install required packages/libraries
RUN apt-get update && \
apt-get -yq dist-upgrade && \
apt-get install -y git gcc openssl libyaml-dev libyaml-cpp-dev libyaml-cpp0.6 libffi-dev libffi7 libreadline-dev libsodium-dev \
zlib1g libgdbm-dev libncurses-dev autoconf fontconfig unzip zip sshpass bzip2 libxrender1 libxext6 \
apt-get install -y git gcc openssl libyaml-dev libyaml-cpp-dev libyaml-cpp0.6 libffi-dev libffi6 libreadline-dev libsodium-dev \
zlibc libgdbm-dev libncurses-dev autoconf fontconfig unzip zip sshpass bzip2 libxrender1 libxext6 \
build-essential nodejs yarn=$YARN_VERSION-1 && \
apt-get autoremove -y

Expand Down
6 changes: 3 additions & 3 deletions .docker/development/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM --platform=linux/amd64 ruby:2.7.8 AS polypress
FROM --platform=linux/amd64 ruby:3.4.2 AS polypress

LABEL author="IdeaCrew"
LABEL author="DCHBX"

ENV HOME /polypress
RUN mkdir -p $HOME
WORKDIR $HOME

RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -

RUN apt-get update \
&& apt-get -yq dist-upgrade \
Expand Down
60 changes: 36 additions & 24 deletions .docker/production/Dockerfile.gha
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
############################################

# Taken from .ruby-version
ARG RUBY_VERSION=2.7.8
ARG RUBY_VERSION=3.4.2
ARG NODE_VERSION=14.21.3
FROM ruby:$RUBY_VERSION-slim-bullseye as base
LABEL author="IdeaCrew"
FROM ruby:$RUBY_VERSION-slim-bookworm as base
LABEL author="DCHBX"

ENV USERNAME=polypress

ARG DEBIAN_FRONTEND=noninteractive

# Taken from Gemfile.lock
ARG BUNDLER_VERSION=2.2.24
ARG BUNDLER_VERSION=2.5.22

# Must be set as ENV variable to override the default
# Must be set as ENV variable to overrride the default
ENV BUNDLER_VERSION=$BUNDLER_VERSION

# Needed for Java install
Expand All @@ -29,18 +29,21 @@ RUN apt-get update \
curl \
fontconfig \
libcurl4 \
libffi7 \
libffi-dev \
libsodium23 \
libxext6 \
libxrender1 \
libyaml-cpp0.6 \
libyaml-dev \
nodejs \
default-jre \
openssl \
nano \
sshpass \
unzip \
vim \
zip \
zlib1g \
libjemalloc2 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& truncate -s 0 /var/log/*log
Expand All @@ -50,8 +53,6 @@ RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2
&& /tmp/aws/install \
&& rm -rf /tmp/aws /tmp/awscliv2.zip awscliv2.zip

RUN mkdir /etc/infra

# Configure bundler and PATH, install bundler version
ENV GEM_HOME=/usr/local/bundle
ENV BUNDLE_PATH=$GEM_HOME
Expand Down Expand Up @@ -114,16 +115,23 @@ RUN apt-get update -qq && \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& truncate -s 0 /var/log/*log

COPY --from=node_runtime /usr/local/bin/node /usr/local/bin/node
COPY --from=node_runtime /usr/local/bin/npm /usr/local/bin/npm
COPY --from=node_runtime /usr/local/bin/npx /usr/local/bin/npx
COPY --from=node_runtime /usr/local/lib/node_modules /usr/local/lib/node_modules
ARG NODE_MAJOR=20
ENV NODE_MAJOR=$NODE_MAJOR
RUN curl -fsSL https://deb.nodesource.com/setup_$NODE_MAJOR.x | bash -

RUN ln -sf /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \
&& ln -sf /usr/local/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx \
&& npm install -g yarn@1
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list

RUN node --version && npm --version && yarn --version
RUN apt-get update -qq \
&& apt-get install -yq --no-install-recommends \
build-essential \
git \
libpq-dev \
nodejs \
yarn \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& truncate -s 0 /var/log/*log

########################################################
### Node and Bundle for production ###
Expand All @@ -147,7 +155,7 @@ ARG RABBITMQ_VHOST=event_source
COPY --chown=$USERNAME:$USERNAME package.json $HOME/
COPY --chown=$USERNAME:$USERNAME yarn.lock $HOME/

RUN yarn install \
RUN yarn install --check-files \
&& (rm -rf /tmp/* || true)

COPY --chown=$USERNAME:$USERNAME ./project_gems/effective_datatables-2.6.14/effective_datatables-2.6.14.gemspec $HOME/project_gems/effective_datatables-2.6.14/effective_datatables-2.6.14.gemspec
Expand All @@ -157,15 +165,18 @@ COPY --chown=$USERNAME:$USERNAME ./project_gems/liquid-5.0.1/lib/liquid/version.
COPY --chown=$USERNAME:$USERNAME ./Gemfile $HOME/Gemfile
COPY --chown=$USERNAME:$USERNAME ./Gemfile.lock $HOME/Gemfile.lock

COPY --chown=$USERNAME:$USERNAME . $HOME
COPY --chown=$USERNAME:$USERNAME ./.docker/config/master.key $HOME/config
COPY --chown=$USERNAME:$USERNAME ./.docker/config/credentials.yml.enc $HOME/config
COPY --chown=$USERNAME:$USERNAME ./.docker/config/mongoid.yml $HOME/config
ARG GEM_OAUTH_TOKEN
ARG BUNDLE_GITHUB__COM=$GEM_OAUTH_TOKEN

RUN bundle config set --local without 'development test' \
&& bundle install

RUN bundle exec rails webpacker:install:erb
RUN bundle exec rails shakapacker:install

COPY --chown=$USERNAME:$USERNAME . $HOME
COPY --chown=$USERNAME:$USERNAME ./.docker/config/master.key $HOME/config
COPY --chown=$USERNAME:$USERNAME ./.docker/config/credentials.yml.enc $HOME/config
COPY --chown=$USERNAME:$USERNAME ./.docker/config/mongoid.yml $HOME/config

RUN bundle exec rails assets:precompile \
&& yarn cache clean \
Expand Down Expand Up @@ -214,6 +225,7 @@ COPY --chown=$USERNAME:$USERNAME ./.docker/config/mongoid.yml $HOME/config
COPY --chown=$USERNAME:$USERNAME ./.docker/config/credentials.yml.enc $HOME/config
COPY --chown=$USERNAME:$USERNAME ./.docker/config/master.key $HOME/config

RUN echo '[ ! -z "$TERM" -a -r /etc/infra/motd ] && cat /etc/infra/motd' >> /etc/bash.bashrc

USER $USERNAME

ENTRYPOINT ["bin/docker-entrypoint"]
3 changes: 3 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ Bundler/OrderedGems:

Gemspec/OrderedDependencies:
Enabled: false

Style/SafeNavigationChainLength:
Enabled: false
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.8
3.4.2
41 changes: 19 additions & 22 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.7.8'
ruby '3.4.2'

gem 'aca_entities', git: 'https://github.com/ideacrew/aca_entities.git', branch: 'trunk'
gem 'aca_entities', git: 'https://github.com/ideacrew/aca_entities.git', ref: '0350721'
# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.4', require: false
gem 'bootsnap', '>= 1.10.3', require: false

gem 'ckeditor', '~> 4.2.4'
gem 'combine_pdf', '~> 1.0'
gem 'config', '~> 2.0' # Deprecate for Resource Registry
gem 'config', '~> 5.1' # Deprecate for Resource Registry
gem 'csv'

gem 'devise', '~> 4.8'
# for account locking
Expand All @@ -29,11 +30,11 @@ gem 'effective_datatables', path: './project_gems/effective_datatables-2.6.14'

gem 'event_source',
git: 'https://github.com/ideacrew/event_source.git',
branch: 'trunk'
ref: '7530e5a' # not merged yet

gem 'sneakers', '~> 2.12'

gem 'httparty', '~> 0.16'
gem 'httparty', '~> 0.21.0'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
Expand All @@ -43,35 +44,31 @@ gem 'jquery-ui-rails'
# Had to clone to make nested search work in where filter
gem 'liquid', path: './project_gems/liquid-5.0.1'

gem 'mongoid', '~> 7.3.3'
gem 'mongoid', '~> 8.1.0'
gem 'mongoid-locker'

gem 'prawn', '~> 2.2'
gem 'prawn-templates', '~> 0.1.2'

gem 'pundit', '~> 2.1.0'

gem 'puma', '~> 5.0'
gem 'puma', '~> 6.0'
# Use SCSS for stylesheets

gem 'rails', '~> 6.1.4'
gem 'rails', '~> 7.2'

# Use Puma as the app server
gem 'resource_registry',
git: 'https://github.com/ideacrew/resource_registry.git',
branch: 'trunk'
ref: '846050d' # not merged yet
# gem 'resource_registry', path: '../resource_registry'

gem 'roo', '~> 2.7.0'
gem 'roo', '~> 2.10.1'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'sass-rails', '>= 6'
gem 'sass-rails', '>= 6' # This is required for ckeditor-4 gem.

# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'

gem 'webpacker', '~> 5.0'
gem 'shakapacker', '~> 7.0'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
Expand All @@ -89,9 +86,9 @@ group :development, :test do
gem 'database_cleaner-mongoid'
gem 'factory_bot_rails'
gem 'pry-byebug', require: false
gem 'rspec-rails', '~> 5.0'
gem 'rspec-rails', '~> 7.0'
gem 'shoulda-matchers', '~> 3'
gem 'yard'
gem 'yard', '0.9.36'
gem 'rubocop-git'
end

Expand All @@ -105,21 +102,21 @@ group :development do
# Display performance information such as SQL time and flame graphs for each request in your browser.
# Can be configured to work on production as well see: https://github.com/MiniProfiler/rack-mini-profiler/blob/master/README.md
gem 'rack-mini-profiler', '~> 2.0', require: false
gem 'rubocop', require: false
gem 'rubocop', '~> 1.69.0'
gem 'rubocop-rails', require: false
gem 'rubocop-rake'
gem 'rubocop-rspec'

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring', '~> 4.2.1'

# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 4.1.0'
end

group :production do
gem 'eye', '0.10.0'
gem 'unicorn', '~> 4.8'
gem 'unicorn', '~> 6.1'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
Expand Down
Loading
Loading