Skip to content

Commit

Permalink
Base image installation moved to separate Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
dolsysmith committed Jul 31, 2024
1 parent f883d24 commit 1f00495
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 33 deletions.
34 changes: 1 addition & 33 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,41 +1,9 @@
# When upgrading passenger-ruby image version, make sure to update passenger version in Gemfile
FROM phusion/passenger-ruby27:2.5.0
FROM ghcr.io/gwu-libraries/scholarspace-base:latest

LABEL org.opencontainers.image.source=https://github.com/gwu-libraries/scholarspace-hyrax
LABEL org.opencontainers.image.description="Dockerized version of our Hyrax application, GW ScholarSpace"
LABEL org.opencontainers.image.licenses="MIT"

RUN apt update && apt install -y libpq-dev unzip clamav-daemon curl libreoffice libcurl4-openssl-dev ffmpeg gnupg2 libxml2 libxml2-dev wget

RUN apt update && apt build-dep -y imagemagick

RUN apt install -y checkinstall libwebp-dev libopenjp2-7-dev librsvg2-dev libde265-dev

RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN cd /opt \
&& wget https://www.imagemagick.org/archive/releases/ImageMagick-7.1.1-13.tar.xz \
&& tar xf ImageMagick-7.1.1-13.tar.xz \
&& cd ImageMagick-7.1.1-13 \
&& ./configure --enable-shared --with-modules --with-gslib \
&& make \
&& make install \
&& ldconfig /usr/local/lib \
&& identify -version \
&& rm /opt/ImageMagick-7.1.1-13.tar.xz

# FITS install
WORKDIR /usr/local/bin

RUN wget https://github.com/harvard-lts/fits/releases/download/1.5.0/fits-1.5.0.zip \
&& unzip fits-1.5.0.zip -d fits-1.5.0 \
&& rm fits-1.5.0.zip \
&& chmod a+x fits-1.5.0/fits*.sh

# Uninstall Ruby version from image and install our version
# bash -lc is necessary per the configuration of the base image
RUN bash -lc "rvm remove ruby-2.7.7 && rvm install ruby-2.7.3"

# Hyrax directories
RUN mkdir -p /opt/scholarspace/scholarspace-hyrax \
&& mkdir -p /opt/scholarspace/scholarspace-tmp \
Expand Down
35 changes: 35 additions & 0 deletions Dockerfile-base
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# When upgrading passenger-ruby image version, make sure to update passenger version in Gemfile
FROM phusion/passenger-ruby27:2.5.0

LABEL org.opencontainers.image.source=https://github.com/gwu-libraries/scholarspace-hyrax

RUN apt update && apt install -y libpq-dev unzip clamav-daemon curl libreoffice libcurl4-openssl-dev ffmpeg gnupg2 libxml2 libxml2-dev wget

RUN apt update && apt build-dep -y imagemagick

RUN apt install -y checkinstall libwebp-dev libopenjp2-7-dev librsvg2-dev libde265-dev

RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN cd /opt \
&& wget https://www.imagemagick.org/archive/releases/ImageMagick-7.1.1-13.tar.xz \
&& tar xf ImageMagick-7.1.1-13.tar.xz \
&& cd ImageMagick-7.1.1-13 \
&& ./configure --enable-shared --with-modules --with-gslib \
&& make \
&& make install \
&& ldconfig /usr/local/lib \
&& identify -version \
&& rm /opt/ImageMagick-7.1.1-13.tar.xz

# FITS install
WORKDIR /usr/local/bin

RUN wget https://github.com/harvard-lts/fits/releases/download/1.5.0/fits-1.5.0.zip \
&& unzip fits-1.5.0.zip -d fits-1.5.0 \
&& rm fits-1.5.0.zip \
&& chmod a+x fits-1.5.0/fits*.sh

# Uninstall Ruby version from image and install our version
# bash -lc is necessary per the configuration of the base image
RUN bash -lc "rvm remove ruby-2.7.7 && rvm install ruby-2.7.3"

0 comments on commit 1f00495

Please sign in to comment.