Skip to content

Commit

Permalink
Merge pull request #1658 from psu-libraries/preview/docker-updates
Browse files Browse the repository at this point in the history
Preview/docker updates
  • Loading branch information
jrpatterson authored Jan 8, 2025
2 parents 1771758 + 1ee9b07 commit 720e747
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 38 deletions.
17 changes: 8 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: 2.1

orbs:
docker: circleci/docker@2.1.2
browser-tools: circleci/browser-tools@1.4.7
docker: circleci/docker@2.6.0
browser-tools: circleci/browser-tools@1.4.8

jobs:
release:
Expand Down Expand Up @@ -30,7 +30,6 @@ jobs:
user: root
steps:
- setup_remote_docker:
version: docker24
docker_layer_caching: true
- checkout
- docker/check:
Expand Down Expand Up @@ -60,7 +59,7 @@ jobs:
./generate_app
test:
docker:
- image: cimg/ruby:3.1.2-browsers
- image: cimg/ruby:3.1.6-browsers
- image: redis:6.2.6
- image: minio/minio:RELEASE.2021-03-17T02-33-02Z
entrypoint:
Expand Down Expand Up @@ -112,9 +111,9 @@ jobs:
curl -L https://npmjs.com/install.sh | sudo bash
- run:
name: "Install dependencies for thumbnails"
command: |
command: |
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo apt-get update
sudo apt-get update
sudo apt-get install -y imagemagick ghostscript libreoffice
sudo cp config/policy.xml /etc/ImageMagick-6/policy.xml
- run:
Expand All @@ -135,7 +134,7 @@ jobs:
- save_cache:
paths:
- vendor/bundle
key: bundle1-{{ checksum "Gemfile.lock" }}
key: bundle1-{{ checksum "Gemfile.lock" }}
- save_cache:
key: yarn1-{{ checksum "yarn.lock" }}
paths:
Expand Down Expand Up @@ -171,11 +170,11 @@ workflows:
- /.*/
- test
- publish:
context:
context:
- org-global

- deploy:
context:
context:
- org-global
requires:
- test
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RSpec/MultipleMemoizedHelpers:
Enabled: false

AllCops:
TargetRubyVersion: 3.1.2
TargetRubyVersion: 3.1.6
Exclude:
- 'db/**/*'
- 'script/**/*'
Expand Down
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.2
3.1.6
31 changes: 15 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
FROM harbor.k8s.libraries.psu.edu/library/ruby-3.1.2-node-16:20240701 as base
FROM harbor.k8s.libraries.psu.edu/library/ruby-3.1.6-node-16:20241218 AS base
ARG UID=3000

COPY bin/vaultshell /usr/local/bin/
USER root
RUN apt-get update && \
apt-get install --no-install-recommends -y \
shared-mime-info \
imagemagick \
ghostscript\
libreoffice && \
rm -rf /var/lib/apt/lists*
apt-get install --no-install-recommends -y \
shared-mime-info \
imagemagick \
ghostscript\
libreoffice && \
rm -rf /var/lib/apt/lists*

COPY config/policy.xml /etc/ImageMagick-6/policy.xml
RUN useradd -u $UID app -d /app
RUN mkdir /app/tmp
# adding this in attempts to see what happens with permissions
# adding this in attempts to see what happens with permissions
RUN mkdir /tmp/app/
RUN chown app:app /tmp/app && chmod 775 /tmp/app
RUN chown -R app /app
RUN chown app:app /tmp/app && chmod 755 /tmp/app
COPY Gemfile Gemfile.lock /app/
RUN chown -R app:app /app
USER app


COPY Gemfile Gemfile.lock /app/
# in the event that bundler runs outside of docker, we get in sync with it's bundler version
RUN gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)"
RUN bundle config set path 'vendor/bundle'
Expand All @@ -31,7 +30,7 @@ RUN bundle install && \


COPY package.json yarn.lock /app/
RUN yarn --frozen-lockfile && \
RUN yarn install --frozen-lockfile && \
rm -rf /app/.cache && \
rm -rf /app/tmp

Expand All @@ -40,11 +39,11 @@ COPY --chown=app . /app

CMD ["/app/bin/startup"]

FROM base as dev
FROM base AS dev

USER root
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list
&& echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' >> /etc/apt/sources.list.d/google.list

RUN apt-get update && apt-get install -y x11vnc \
xvfb \
Expand All @@ -64,7 +63,7 @@ USER app
RUN bundle config set path 'vendor/bundle'

# Final Target
FROM base as production
FROM base AS production

# Clean up Bundle
RUN bundle install --without development test && \
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '3.1.2'
ruby '3.1.6'

gem 'aasm'
gem 'after_commit_everywhere', '~> 0.1', '>= 0.1.5'
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ DEPENDENCIES
webmock

RUBY VERSION
ruby 3.1.2
ruby 3.1.6

BUNDLED WITH
2.3.5
17 changes: 8 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.5'
x-web_env: &web_env
environment:
REDIS_HOST: redis
Expand Down Expand Up @@ -38,8 +37,8 @@ services:
tty: true
stdin_open: true
<<: *web_env
build:
context: .
build:
context: .
target: dev
volumes:
- bundle-data:/app/vendor/bundle
Expand All @@ -54,14 +53,14 @@ services:
restart: always
volumes:
- minio-data:/data
environment:
environment:
MINIO_ACCESS_KEY: ${AWS_ACCESS_KEY_ID:-scholarsphere}
MINIO_SECRET_KEY: ${AWS_SECRET_ACCESS_KEY:-scholarsphere}
ports:
- ${MINIO_PORT:-9000}:9000
entrypoint:
- /bin/sh
- -c
- -c
- mkdir -p /data/scholarsphere; minio --compat server --address ':9000' /data
solr:
image: solr:8.11.1-slim
Expand Down Expand Up @@ -90,10 +89,10 @@ services:
volumes:
- db-data:/var/lib/postgresql/data

networks:
default:
driver: bridge
driver_opts:
networks:
default:
driver: bridge
driver_opts:
com.docker.network.driver.mtu: 1400

volumes:
Expand Down

0 comments on commit 720e747

Please sign in to comment.