-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
110 lines (98 loc) · 3.72 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
ARG HYRAX_IMAGE_VERSION=v4.0.0.beta2
FROM ghcr.io/samvera/hyrax/hyrax-base:$HYRAX_IMAGE_VERSION as hyku-base
USER root
RUN apk --no-cache upgrade && \
apk --no-cache add \
bash \
clamav \
clamav-daemon \
cmake \
exiftool \
ffmpeg \
git \
imagemagick \
less \
libreoffice \
libreoffice-lang-uk \
libxml2-dev \
mediainfo \
nodejs \
openjdk17-jre \
openjpeg-dev \
openjpeg-tools \
perl \
poppler \
poppler-utils \
postgresql-client \
rsync \
screen \
tesseract-ocr \
vim \
yarn \
&& \
# curl https://sh.rustup.rs -sSf | sh -s -- -y && \
# source "$HOME/.cargo/env" && \
# cargo install rbspy && \
echo "******** Packages Installed *********"
RUN sed -i 's/User clamav/User app/g' /etc/clamav/clamd.conf
RUN mkdir -p /var/run/clamav && chown -R app:app /var/run/clamav
RUN mkdir -p /var/log/clamav && chown -R app:app /var/log/clamav
RUN chown -R app:app /var/lib/clamav
RUN wget https://github.com/ImageMagick/ImageMagick/archive/refs/tags/7.1.0-57.tar.gz \
&& tar xf 7.1.0-57.tar.gz \
&& apk --no-cache add \
libjpeg-turbo openjpeg libpng tiff librsvg libgsf libimagequant poppler-qt5-dev \
&& cd ImageMagick* \
&& ./configure \
&& make install \
&& cd $OLDPWD \
&& rm -rf ImageMagick* \
&& rm -rf /var/cache/apk/*
ARG VIPS_VERSION=8.11.3
RUN set -x -o pipefail \
&& wget -O- https://github.com/libvips/libvips/releases/download/v${VIPS_VERSION}/vips-${VIPS_VERSION}.tar.gz | tar xzC /tmp \
&& apk --no-cache add \
libjpeg-turbo openjpeg libpng tiff librsvg libgsf libimagequant poppler-qt5-dev \
&& apk add --virtual vips-dependencies build-base \
libjpeg-turbo-dev libpng-dev tiff-dev librsvg-dev libgsf-dev libimagequant-dev \
&& cd /tmp/vips-${VIPS_VERSION} \
&& ./configure --prefix=/usr \
--disable-static \
--disable-dependency-tracking \
--enable-silent-rules \
&& make -s install-strip \
&& cd $OLDPWD \
&& rm -rf /tmp/vips-${VIPS_VERSION} \
&& apk del --purge vips-dependencies \
&& rm -rf /var/cache/apk/*
USER app
RUN mkdir -p /app/fits && \
cd /app/fits && \
wget https://github.com/harvard-lts/fits/releases/download/1.5.5/fits-1.5.5.zip -O fits.zip && \
unzip fits.zip && \
rm fits.zip && \
chmod a+x /app/fits/fits.sh
ENV PATH="${PATH}:/app/fits"
# 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
FROM hyku-base as hyku-web
COPY --chown=1001:101 $APP_PATH/Gemfile* /app/samvera/hyrax-webapp/
RUN sh -l -c " \
mkdir -p tmp/shared && \
bundle install --jobs "$(nproc)" && \
sed -i '/require .enumerator./d' /usr/local/bundle/gems/oai-1.1.0/lib/oai/provider/resumption_token.rb && \
sed -i '/require .enumerator./d' /usr/local/bundle/gems/edtf-3.0.7/lib/edtf.rb && \
sed -i '/require .enumerator./d' /usr/local/bundle/gems/csl-1.6.0/lib/csl.rb"
COPY --chown=1001:101 $APP_PATH/bin/db-migrate-seed.sh /app/samvera/
COPY --chown=1001:101 $APP_PATH /app/samvera/hyrax-webapp
ARG HYKU_BULKRAX_ENABLED="true"
RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DB_ADAPTER=nulldb DATABASE_URL='postgresql://fake' bundle exec rake assets:precompile && yarn install
CMD ./bin/web
FROM hyku-web as hyku-worker
RUN freshclam
ENV MALLOC_ARENA_MAX=2
CMD ./bin/worker