-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile-warper
47 lines (32 loc) · 1.43 KB
/
Dockerfile-warper
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
# docker build -t warper:latest -f Dockerfile-warper .
FROM ubuntu:18.04
RUN apt-get update -qq && apt-get install -y --no-install-recommends \
build-essential git curl file \
ruby-dev nodejs libpq-dev postgresql-client ruby-mapscript \
zlib1g-dev liblzma-dev imagemagick gdal-bin gnupg \
python-pip python-setuptools \
logrotate nginx-full gettext-base
RUN pip install -U pillow modestmaps google-cloud-storage
## install gcsfuse for use mounting cloud storage
RUN echo "deb http://packages.cloud.google.com/apt gcsfuse-bionic main" | tee /etc/apt/sources.list.d/gcsfuse.list
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
RUN apt-get update -qq && apt-get install -y gcsfuse
#for 18.04 we need to loosen up the imagemagick policy limits
COPY ./warper/config/imagemagick-policy.xml /etc/ImageMagick-6/policy.xml
#copy log rotate
COPY ./warper/config/mapwarper.logrotate /etc/logrotate.d/warper
RUN chmod 0644 /etc/logrotate.d/warper
RUN mkdir -p /app
WORKDIR /app
COPY ./warper/Gemfile Gemfile
COPY ./warper/Gemfile.lock Gemfile.lock
RUN echo "gem: --no-document" >> ~/.gemrc
RUN gem install bundler -v=1.17.3
RUN gem install bundle
RUN gem update --system
RUN bundle update --bundler
RUN bundle install
COPY ./warper .
RUN bash ./lib/cloudbuild/copy_configs.sh
RUN bundle exec rake assets:precompile RAILS_ENV=production SECRET_KEY_BASE=dummytokenforbuild
ENTRYPOINT ["nginx", "-g", "daemon off;"]