Skip to content
Open
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
82 changes: 21 additions & 61 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,71 +1,31 @@
FROM ruby:2.5.3 as hyrax-base
ARG RUBY_VERSION=2.7.8
FROM ruby:$RUBY_VERSION-alpine as builder

RUN echo "deb http://archive.debian.org/debian/ stretch main" > /etc/apt/sources.list && \
echo "deb http://archive.debian.org/debian-security/ stretch/updates main" >> /etc/apt/sources.list && \
apt-get update -qq && \
apt-get -y install apt-transport-https && \
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 && \
curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
apt-get update -qq && \
apt-get install -y \
build-essential \
cmake \
exiftool \
ffmpeg \
ghostscript \
imagemagick \
libpq-dev \
libreoffice \
libvips-dev \
netcat \
nodejs \
screen \
unzip \
vim \
yarn \
zip \
&& \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
yarn config set no-progress && \
yarn config set silent
RUN apk add build-base
RUN wget -O - https://github.com/jemalloc/jemalloc/releases/download/5.2.1/jemalloc-5.2.1.tar.bz2 | tar -xj && \
cd jemalloc-5.2.1 && \
./configure && \
make && \
make install

# If changes are made to fits version or location,
# amend `LD_LIBRARY_PATH` in docker-compose.yml accordingly.
RUN mkdir -p /app/fits && \
curl -fSL -o /app/fits/fits-latest.zip https://github.com/harvard-lts/fits/releases/download/1.4.0/fits-latest.zip && \
cd /app/fits && unzip fits-latest.zip && chmod +X /app/fits/fits.sh && \
cp -r /app/fits/* /usr/local/bin/
FROM ghcr.io/scientist-softserv/dev-ops/samvera:f71b284f as hyrax-base

# Change the order so exif tool is better positioned and use the biggest size if more than one
# size exists in an image file (pyramidal tifs mostly)
COPY --chown=1001:101 ./ops/fits.xml /app/fits/xml/fits.xml
COPY --chown=1001:101 ./ops/exiftool_image_to_fits.xslt /app/fits/xml/exiftool/exiftool_image_to_fits.xslt
RUN ln -sf /usr/lib/libmediainfo.so.0 /app/fits/tools/mediainfo/linux/libmediainfo.so.0 && \
ln -sf /usr/lib/libzen.so.0 /app/fits/tools/mediainfo/linux/libzen.so.0
COPY --chown=1001:101 $APP_PATH/Gemfile* /app/samvera/hyrax-webapp/
RUN bundle install --jobs "$(nproc)"
COPY --chown=1001:101 $APP_PATH/bin/db-migrate-seed.sh /app/samvera/

COPY ./ops/bin /app/samvera
ENV PATH="/app/samvera:$PATH"
ENV RAILS_ROOT="/app/samvera/hyrax-webapp"
COPY --chown=1001:101 $APP_PATH /app/samvera/hyrax-webapp

RUN mkdir /opt/csv
RUN mkdir -p /app/samvera/hyrax-webapp
WORKDIR /app/samvera/hyrax-webapp
ADD Gemfile /app/samvera/hyrax-webapp/Gemfile
ADD Gemfile.lock /app/samvera/hyrax-webapp/Gemfile.lock
# for engine dev only
#ADD vendor/engines/bulkrax /app/samvera/hyrax-webapp/vendor/engines/bulkrax
ARG HYKU_BULKRAX_ENABLED="true"
RUN sh -l -c " \
yarn install && \
RAILS_ENV=production SECRET_KEY_BASE=FAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKE DB_ADAPTER=nulldb DATABASE_URL='postgresql://fake' bundle exec rake assets:precompile"
RUN ln -sf /app/samvera/branding /app/samvera/hyrax-webapp/public/branding

ENV BUNDLE_JOBS=4
RUN cd /app/samvera/hyrax-webapp && ls -l && bundle install
ADD . /app/samvera/hyrax-webapp
RUN npm install shx --global && cd /app/samvera/hyrax-webapp && yarn install
RUN cd /app/samvera/hyrax-webapp && NODE_ENV=production DB_ADAPTER=nulldb bundle exec rake assets:clobber assets:precompile && ln -s /app/samvera/branding /app/samvera/hyrax-webapp/public/branding
EXPOSE 3000
CMD ./bin/web

ENTRYPOINT ["hyrax-entrypoint.sh"]
CMD ["bundle", "exec", "puma", "-v", "-b", "tcp://0.0.0.0:3000"]
COPY --from=builder /usr/local/lib/libjemalloc.so.2 /usr/local/lib/
ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so.2

FROM hyrax-base as hyrax-worker
ENV MALLOC_ARENA_MAX=2
CMD ./bin/worker
15 changes: 9 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
source 'https://rubygems.org'
ruby '2.5.3'

gem 'rails', '5.1.6'
gem 'rails', '~> 5.2'

gem 'activejob-scheduler', git: 'https://github.com/notch8/activejob-scheduler.git'
gem 'blacklight_range_limit'
# TODO: do a new release and use the versioned version of bulkrax when the upgrade work is complete
gem 'bulkrax', git: 'https://github.com/samvera-labs/bulkrax.git', branch: 'v4.4-patch'
# gem 'bulkrax', '~> 4.4.0'
gem 'bootsnap'
gem 'bulkrax', git: 'https://github.com/samvera/bulkrax.git', branch: 'oai-fixes'
# gem 'bulkrax', path: 'vendor/engines/bulkrax'
gem 'activerecord-nulldb-adapter'
gem 'bixby', group: %i[development test]
gem 'byebug', group: %i[development test]
Expand All @@ -23,10 +22,11 @@ gem 'factory_bot_rails', group: %i[development test]
gem 'fcrepo_wrapper', group: %i[development test]
gem 'final_redirect_url'
gem 'flutie'
gem 'marcel'
gem 'oai', git: 'https://github.com/notch8/ruby-oai.git', branch: 'quote-marks'
gem 'health-monitor-rails', git: 'https://github.com/notch8/health-monitor-rails.git'
# , git: 'https://github.com/orangewolf/hyrax.git', branch: 'collection_path_js_fix_2.5.1'
gem 'hyrax', '~> 2.6'
gem 'hyrax', '~> 2.9.6'
gem 'hyrax-iiif_av', git: 'https://github.com/samvera-labs/hyrax-iiif_av.git', branch: 'uv_meet_av'
# remove if iiif 0.6 is supported or if upgraded to hyrax 3
gem 'iiif_manifest', git: 'https://github.com/samvera-labs/iiif_manifest.git', ref: '4219eb57ae9fbcd178391f401928040ebe057529'
Expand All @@ -45,6 +45,9 @@ gem 'pronto-rails_schema', require: false
gem 'pronto-rubocop', require: false
gem 'pry-byebug', group: %i[development test]
gem 'puma', '~> 3.7'
gem 'redis', '~> 4.0'
gem 'redis-namespace', '~> 1.5'
gem 'redlock', '~> 1.0'
gem 'riiif', '~> 1.1'
gem 'rinku'
gem 'rsolr', '~> 2.2'
Expand Down
Loading