Skip to content

Commit

Permalink
Merge branch 'develop' into features/custom-docx-reports
Browse files Browse the repository at this point in the history
  • Loading branch information
aignatov-bio committed Nov 14, 2024
2 parents 6d76966 + 2d70773 commit d3dc404
Show file tree
Hide file tree
Showing 283 changed files with 7,313 additions and 1,622 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,7 @@ public/marvin4js-license.cxl

/app/assets/builds/*
!/app/assets/builds/.keep

# Ignore automatically generated js-routes files.
/app/javascript/routes.js
/app/javascript/routes.d.ts
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ before_install:
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-linux-x86_64 > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- sudo chown --recursive 1000 .
- make docker-ci
script:
- make tests-ci
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.2.2-bookworm
FROM ruby:3.2-bookworm
MAINTAINER SciNote <info@scinote.net>

# additional dependecies
Expand All @@ -20,21 +20,26 @@ RUN apt-get update -qq && \
fonts-wqy-microhei \
fonts-wqy-zenhei \
libfile-mimeinfo-perl \
chromium-driver \
chromium \
chromium-sandbox \
yarnpkg && \
ln -s /usr/lib/x86_64-linux-gnu/libvips.so.42 /usr/lib/x86_64-linux-gnu/libvips.so && \
rm -rf /var/lib/apt/lists/*

ENV PATH=/usr/share/nodejs/yarn/bin:$PATH

RUN yarn add puppeteer@npm:puppeteer-core
RUN yarn add puppeteer@npm:puppeteer-core@^22.15.0

ENV BUNDLE_PATH /usr/local/bundle/

# create app directory
ENV APP_HOME /usr/src/app
ENV PATH $APP_HOME/bin:$PATH
RUN mkdir $APP_HOME
RUN adduser --uid 1000 scinote
RUN chown scinote:scinote $APP_HOME
USER scinote
ENV CHROMIUM_PATH=$APP_HOME/bin/chromium
WORKDIR $APP_HOME

CMD rails s -b 0.0.0.0
18 changes: 12 additions & 6 deletions Dockerfile.production
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Building stage
FROM ruby:3.2.2-bookworm AS builder
FROM ruby:3.2-bookworm AS builder

RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
RUN \
Expand All @@ -23,7 +23,7 @@ COPY . $APP_HOME
RUN rm -f $APP_HOME/config/application.yml $APP_HOME/production.env
WORKDIR $APP_HOME
RUN \
--mount=target=$APP_HOME/tmp/bundle,type=cache \
--mount=target=/usr/src/app/tmp/bundle,type=cache \
bundle config set without 'development test' && \
bundle config set path '/usr/src/app/tmp/bundle' && \
bundle install --jobs `nproc` && \
Expand All @@ -34,14 +34,14 @@ RUN \

RUN \
--mount=type=cache,target=/usr/local/share/.cache/yarn/v6,sharing=locked \
--mount=type=cache,target=$APP_HOME/node_modules,sharing=locked \
--mount=type=cache,target=/usr/src/app/node_modules,sharing=locked \
DATABASE_URL=postgresql://postgres@db/scinote_production \
SECRET_KEY_BASE=dummy \
DEFACE_ENABLED=true \
bash -c "rake assets:precompile && rake deface:precompile"
bash -c "rake assets:precompile && rake deface:precompile && rm -rf ./tmp/cache"

# Final stage
FROM ruby:3.2.2-bookworm AS runner
FROM ruby:3.2-bookworm AS runner
MAINTAINER SciNote <info@scinote.net>

RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
Expand Down Expand Up @@ -76,6 +76,7 @@ RUN \
libvips42 \
graphviz \
chromium \
chromium-sandbox \
libfile-mimeinfo-perl \
yarnpkg && \
/usr/share/nodejs/yarn/bin/yarn add puppeteer@npm:puppeteer-core@^22.15.0 && \
Expand All @@ -88,6 +89,8 @@ RUN \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
touch /etc/build-${BUILD_TIMESTAMP} && \
DEBIAN_FRONTEND=noninteractive \
apt-get remove -y *-dev && \
apt-get autoremove -y && \
apt-get update -qq && \
apt-get upgrade -y && \
rm -rf /var/lib/apt/lists/*
Expand All @@ -98,7 +101,10 @@ ENV GEM_HOME=$APP_HOME/vendor/bundle/ruby/3.2.0
ENV PATH=$GEM_HOME/bin:$PATH
ENV BUNDLE_APP_CONFIG=.bundle

COPY --from=builder $APP_HOME $APP_HOME
RUN adduser --uid 1000 scinote
USER scinote

COPY --from=builder --chown=scinote:scinote $APP_HOME $APP_HOME

WORKDIR $APP_HOME

Expand Down
9 changes: 4 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# frozen_string_literal: true

source 'http://rubygems.org'
source 'https://rubygems.org'

ruby '3.2.2'
ruby '~> 3.2.2'

gem 'activerecord-session_store'
gem 'bootsnap', require: false
Expand Down Expand Up @@ -62,6 +62,7 @@ gem 'logging', '~> 2.0.0'
gem 'nested_form_fields'
gem 'nokogiri', '~> 1.16.5' # HTML/XML parser
gem 'noticed'
gem 'oj'
gem 'rails_autolink', '~> 1.1', '>= 1.1.6'
gem 'rgl' # Graph framework for project diagram calculations
gem 'roo', '~> 2.10.0' # Spreadsheet parser
Expand All @@ -81,9 +82,6 @@ gem 'aws-sdk-lambda'
gem 'aws-sdk-rails'
gem 'aws-sdk-s3'
gem 'delayed_job_active_record'
gem 'devise-async',
git: 'https://github.com/mhfs/devise-async.git',
branch: 'devise-4.x'
gem 'image_processing'
gem 'img2zpl', git: 'https://github.com/scinote-eln/img2zpl'
gem 'rufus-scheduler'
Expand All @@ -94,6 +92,7 @@ gem 'graphviz'

gem 'cssbundling-rails'
gem 'jsbundling-rails'
gem 'js-routes'

gem 'tailwindcss-rails', '~> 2.4'

Expand Down
Loading

0 comments on commit d3dc404

Please sign in to comment.