-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·64 lines (53 loc) · 2.31 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
FROM ruby:2.7.7
ENV BUNDLER_VERSION=2.4.7
ENV RAILS_VERSION=5.2.8.1
ENV FITS_VERSION=1.6.0
ENV NODE_VERSION=18
# should match local folder of our application
ENV PROJECT_PATH wvu_hyrax
ENV TZ="America/New_York"
USER root
RUN apt-get update && apt-get -y install \
cron \
postgresql-client \
build-essential \
vim \
libreoffice \
openjdk-11-jdk
# Use JEMALLOC instead
# JEMalloc is a faster garbage collection for Ruby.
# -------------------------------------------------------------------------------------------------
RUN apt-get install -y libjemalloc2
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2
# ImageMagic Conversions and FFMPEG Conversions
# -------------------------------------------------------------------------------------------------
RUN apt-get install -y imagemagick ghostscript ffmpeg libgs-dev
# Modifiy ImageMagick's security policy to allow reading and writing PDFs
RUN sed -i 's/policy domain="coder" rights="none" pattern="PDF"/policy domain="coder" rights="read|write" pattern="PDF"/' /etc/ImageMagick-6/policy.xml
# -------------------------------------------------------------------------------------------------
# FITS
# -------------------------------------------------------------------------------------------------
RUN mkdir -p /home/fits && \
cd /home/fits \
&& wget https://github.com/harvard-lts/fits/releases/download/${FITS_VERSION}/fits-${FITS_VERSION}.zip -O fits.zip \
&& unzip fits.zip \
&& rm fits.zip \
&& chmod a+x /home/fits/fits.sh
ENV PATH="${PATH}:/home/fits"
# Node.js
# -------------------------------------------------------------------------------------------------
RUN curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - \
&& apt-get -y install nodejs
# yarn
# -------------------------------------------------------------------------------------------------
RUN 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 \
&& apt-get update \
&& apt-get install -y yarn
RUN mkdir -p /home/${PROJECT_PATH}/
WORKDIR /home/${PROJECT_PATH}
ADD ./${PROJECT_PATH} /home/${PROJECT_PATH}
RUN \
gem update --system --quiet && \
gem install bundler -v ${BUNDLER_VERSION} && \
bundle install --jobs=4 --retry=3