forked from ualbertalib/discovery
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (34 loc) · 1.29 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
FROM phusion/passenger-ruby25
LABEL maintainer="University of Alberta Libraries"
ENV HOME /root
CMD ["/sbin/my_init"]
RUN bash -lc 'rvm install ruby-2.5.3'
RUN bash -lc 'rvm --default use ruby-2.5.3'
RUN bash -lc 'gem install bundler -v 1.17.3'
RUN apt-get update -qq \
&& apt-get install -y build-essential \
mysql-client \
default-jre \
imagemagick \
nodejs \
tzdata \
&& rm -rf /var/lib/apt/lists/*
ENV APP_ROOT /app
RUN mkdir -p $APP_ROOT
WORKDIR $APP_ROOT
# setup nginx/passenger
RUN rm -f /etc/nginx/sites-enabled/default
COPY config/nginx.conf /etc/nginx/sites-enabled/discovery.conf
COPY config/rails-env.conf /etc/nginx/main.d/rails-env.conf
RUN rm -f /etc/service/nginx/down
# 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.
RUN RAILS_ENV=uat SECRET_KEY_BASE=pickasecuretoken bundle exec rake assets:precompile
# change the owner so that the app passenger_user can read and write to the app dir
RUN chown -R app:app .
EXPOSE 80