-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile.deployment
58 lines (45 loc) · 2.04 KB
/
Dockerfile.deployment
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
FROM ruby:3.1
LABEL maintainer="University of Alberta Library"
# Need to add jessie-backports repo so we can get FFMPEG, doesn't come with jessie debian by default
# RUN echo 'deb http://ftp.debian.org/debian jessie-backports main' >> /etc/apt/sources.list
# Autoprefixer doesn’t support Node v4.8.2. Update it.
RUN curl -sL https://deb.nodesource.com/setup_18.x | bash -
## To install the Yarn package manager (rails assets:precompile complains if not installed), run:
RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee /usr/share/keyrings/yarnkey.gpg >/dev/null \
&& echo "deb [signed-by=/usr/share/keyrings/yarnkey.gpg] https://dl.yarnpkg.com/debian stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update -qq \
&& apt-get install -y build-essential \
libpq-dev \
nodejs \
yarn \
tzdata \
# libreoffice \
# imagemagick \
# ghostscript \
# unzip \
# ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# install fits
# RUN mkdir -p /usr/local/fits \
# && cd /usr/local/fits \
# && wget http://projects.iq.harvard.edu/files/fits/files/fits-1.0.6.zip \
# && unzip fits-1.0.6.zip \
# && rm fits-1.0.6.zip \
# && chmod a+x /usr/local/fits/fits-1.0.6/fits.sh \
# && ln -s /usr/local/fits/fits-1.0.6/fits.sh /usr/bin/fits
ENV APP_ROOT /app
RUN mkdir -p $APP_ROOT
WORKDIR $APP_ROOT
# Update bundler
RUN gem update --system
RUN gem install bundler:2.1.4
# Install standard gems
COPY Gemfile* /app/
RUN bundle config --global frozen 1 && \
bundle install -j4 --retry 3
# *NOW* we copy the codebase in
COPY . $APP_ROOT
# Precompile Rails assets. We set a dummy database url/token key
RUN RAILS_ENV=uat DATABASE_URL=postgresql://user:[email protected]/dbname SECRET_KEY_BASE=pickasecuretoken bundle exec rake assets:precompile
EXPOSE 3000
CMD bundle exec puma -C config/puma.rb