forked from samvera/hyku
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
44 lines (33 loc) · 1.24 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
ARG HYRAX_IMAGE_VERSION=3.0.1
FROM ghcr.io/samvera/hyrax/hyrax-base:$HYRAX_IMAGE_VERSION as hyku-base
USER root
ARG EXTRA_APK_PACKAGES="openjdk11-jre"
RUN apk --no-cache upgrade && \
apk --no-cache add \
libxml2-dev \
$EXTRA_APK_PACKAGES
USER app
COPY --chown=1001:101 $APP_PATH /app/samvera/hyrax-webapp
RUN bundle install --jobs "$(nproc)"
RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DB_ADAPTER=nulldb DATABASE_URL='postgresql://fake' bundle exec rake assets:precompile
FROM hyku-base as hyku-worker
ENV MALLOC_ARENA_MAX=2
USER root
ARG EXTRA_WORKER_APK_PACKAGES="ffmpeg"
RUN apk --no-cache add \
mediainfo \
perl \
$EXTRA_WORKER_APK_PACKAGES
USER app
RUN mkdir -p /app/fits && \
cd /app/fits && \
wget https://github.com/harvard-lts/fits/releases/download/1.5.0/fits-1.5.0.zip -O fits.zip && \
unzip fits.zip && \
rm fits.zip && \
chmod a+x /app/fits/fits.sh
ENV PATH="${PATH}:/app/fits"
COPY --chown=1001:101 $APP_PATH /app/samvera/hyrax-webapp
RUN bundle install --jobs "$(nproc)"
# TODO: remove if we dont need assets for worker
# RUN RAILS_ENV=production SECRET_KEY_BASE=`bin/rake secret` DB_ADAPTER=nulldb DATABASE_URL='postgresql://fake' bundle exec rake assets:precompile
CMD bundle exec sidekiq