forked from ualbertalib/jupiter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.deployment
54 lines (42 loc) · 1.97 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
FROM ruby:2.5.0
LABEL maintainer="University of Alberta Libraries"
# 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_10.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 | apt-key add - \
&& echo "deb 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
# Preinstall gems in an earlier layer so we don't reinstall every time any file changes.
COPY Gemfile $APP_ROOT
COPY Gemfile.lock $APP_ROOT
RUN bundle install --without development test --jobs=3 --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