forked from Digital-Repository-of-Ireland/dri-spotlight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.base
46 lines (36 loc) · 1.5 KB
/
Dockerfile.base
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
FROM phusion/passenger-ruby27:2.3.0
RUN apt-get update -qq && \
apt-get install -y \
build-essential \
imagemagick \
libpq-dev \
libsasl2-dev \
netcat \
postgresql-client \
rsync \
tzdata \
unzip \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN curl -sL https://deb.nodesource.com/setup_12.x -o /tmp/nodesource_setup.sh
RUN bash /tmp/nodesource_setup.sh
RUN apt-get install -y nodejs
RUN curl -sL 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 -qq && apt-get install -y yarn
RUN rm /etc/nginx/sites-enabled/default
COPY ops/webapp.conf /etc/nginx/sites-enabled/webapp.conf
COPY ops/env.conf /etc/nginx/main.d/env.conf
ENV APP_HOME /home/app/webapp
RUN mkdir $APP_HOME && chown -R app /home/app
WORKDIR $APP_HOME
ENV BUNDLE_GEMFILE=$APP_HOME/Gemfile \
BUNDLE_JOBS=4
COPY --chown=app Gemfile* $APP_HOME/
RUN /sbin/setuser app bundle install
COPY --chown=app . $APP_HOME
RUN /sbin/setuser app /bin/bash -l -c 'cd /home/app/webapp && rails webpacker:install && DATABASE_ADAPTER=nulldb bundle exec rake assets:precompile'
COPY ops/nginx.sh /etc/service/nginx/run
RUN chmod +x /etc/service/nginx/run
RUN rm -f /etc/service/nginx/down