]> git.openstreetmap.org Git - rails.git/blob - Dockerfile
Introduce docker-compose config for development
[rails.git] / Dockerfile
1 FROM ruby:2.5
2
3 # fixes dpkg man page softlink error while installing postgresql-client [source: https://stackoverflow.com/a/52655008/5350059]
4 RUN mkdir -p /usr/share/man/man1 && \
5     mkdir -p /usr/share/man/man7
6
7 # npm is not available in Debian repo so following official instruction [source: https://github.com/nodesource/distributions/blob/master/README.md#debinstall]
8 RUN curl -sL https://deb.nodesource.com/setup_10.x -o nodesource_setup.sh && \
9     bash nodesource_setup.sh && \
10     rm -f nodesource_setup.sh
11
12 # install packages
13 RUN apt-get update && \
14     apt-get install --no-install-recommends -y \
15       build-essential \
16       curl \
17       imagemagick \
18       libarchive-dev \
19       libffi-dev \
20       libmagickwand-dev \
21       libpq-dev \
22       libsasl2-dev \
23       libxml2-dev \
24       libxslt1-dev \
25       locales \
26       nodejs \
27       osmosis \
28       postgresql-client \
29       ruby-dev && \
30     apt-get clean && \
31     rm -rf /var/lib/apt/lists/*
32
33 # install npm packages
34 RUN npm install -g --unsafe-perm \
35       phantomjs-prebuilt \
36       yarn
37
38 # Setup app location
39 RUN mkdir -p /app
40 WORKDIR /app
41
42 # Install gems
43 ADD Gemfile* /app/
44 RUN bundle install
45
46 # Setup local
47 RUN sed -i -e 's/# en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen && \
48     echo 'LANG="en_GB.UTF-8"'>/etc/default/locale && \
49     dpkg-reconfigure --frontend=noninteractive locales && \
50     update-locale LANG=en_GB.UTF-8
51
52 ENV LANG en_GB.UTF-8