-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (32 loc) · 1 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
FROM ruby:2.5.1
MAINTAINER Jose Angel Parreño <joseangel.parreno@vizzuality.com>
ENV NAME=cw-south-africa
ENV RAKE_ENV=production
ENV RAILS_ENV=production
ENV COUNTRY_ISO=ZAF
ENV CW_API_URL="https://www.climatewatchdata.org/api/v1"
ENV API_URL="/api/v1"
ENV S3_BUCKET_NAME="wri-sites"
# Install dependencies
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
postgresql-client \
&& rm -rf /var/lib/apt/lists/* \
&& curl -sL https://deb.nodesource.com/setup_8.x | bash - \
&& apt-get install -y nodejs build-essential patch zlib1g-dev liblzma-dev libicu-dev \
&& npm install -g yarn
# Create app directory
RUN mkdir -p /opt/$NAME
WORKDIR /opt/$NAME
# Install app dependencies
COPY . /opt/$NAME/
RUN gem install bundler --no-ri --no-rdoc
RUN cd /opt/$NAME && bundle install --jobs 4 --deployment
# Env variables
ARG secretKey
ENV SECRET_KEY_BASE $secretKey
EXPOSE 3000
# Rails assets compile
RUN bundle exec rake assets:precompile
# Start app
ENTRYPOINT ["./entrypoint.sh"]