forked from wvulibraries/hydra_acda_portal_public
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
executable file
·51 lines (40 loc) · 2.49 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
# Use the official Ruby image
# -------------------------------------------------------------------------------------------------
FROM ruby:3.3.5
# Install dependencies
# -------------------------------------------------------------------------------------------------
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs vim cron imagemagick \
ghostscript ffmpeg pdftk qpdf
# Set the working directory
# -------------------------------------------------------------------------------------------------
WORKDIR /home/hydra
# Install Bundler
# -------------------------------------------------------------------------------------------------
RUN gem install bundler
# Copy the Gemfile and Gemfile.lock into the container
# -------------------------------------------------------------------------------------------------
COPY ./hydra/Gemfile ./hydra/Gemfile.lock /home/hydra/
# Install gems
# -------------------------------------------------------------------------------------------------
RUN bundle install
# Copy the rest of the application code into the container
# -------------------------------------------------------------------------------------------------
ADD ./hydra /home/hydra
# Use JEMALLOC instead
# JEMalloc is a faster garbage collection for Ruby.
# -------------------------------------------------------------------------------------------------
RUN apt-get install -y libjemalloc2 libjemalloc-dev
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so
# increase ImageMagick's memory limit
# -------------------------------------------------------------------------------------------------
RUN sed -i -E 's/name="disk" value=".+"/name="disk" value="4GiB"/g' /etc/ImageMagick-6/policy.xml
# 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
# Install Yarn
# -------------------------------------------------------------------------------------------------
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install -y yarn
# Expose port 3000 to the Docker host
EXPOSE 3000