]> git.openstreetmap.org Git - rails.git/blob - Dockerfile
Merge remote-tracking branch 'upstream/pull/4226'
[rails.git] / Dockerfile
1 FROM ubuntu:22.04
2
3 ENV DEBIAN_FRONTEND=noninteractive
4
5 # Install system packages then clean up to minimize image size
6 RUN apt-get update \
7  && apt-get install --no-install-recommends -y \
8       build-essential \
9       curl \
10       default-jre-headless \
11       file \
12       git-core \
13       gpg-agent \
14       libarchive-dev \
15       libffi-dev \
16       libgd-dev \
17       libpq-dev \
18       libsasl2-dev \
19       libvips-dev \
20       libxml2-dev \
21       libxslt1-dev \
22       locales \
23       postgresql-client \
24       ruby \
25       ruby-dev \
26       ruby-bundler \
27       software-properties-common \
28       tzdata \
29       unzip \
30       nodejs \
31       npm \
32  && npm install --global yarn \
33  # We can't use snap packages for firefox inside a container, so we need to get firefox+geckodriver elsewhere
34  && add-apt-repository -y ppa:mozillateam/ppa \
35  && echo "Package: *\nPin: release o=LP-PPA-mozillateam\nPin-Priority: 1001" > /etc/apt/preferences.d/mozilla-firefox \
36  && apt-get install --no-install-recommends -y \
37       firefox-geckodriver \
38  && apt-get clean \
39  && rm -rf /var/lib/apt/lists/*
40
41 # Install compatible Osmosis to help users import sample data in a new instance
42 RUN curl -OL https://github.com/openstreetmap/osmosis/releases/download/0.47.2/osmosis-0.47.2.tgz \
43  && tar -C /usr/local -xzf osmosis-0.47.2.tgz
44
45 ENV DEBIAN_FRONTEND=dialog
46
47 # Setup app location
48 RUN mkdir -p /app
49 WORKDIR /app
50
51 # Install Ruby packages
52 ADD Gemfile Gemfile.lock /app/
53 RUN bundle install
54
55 # Install NodeJS packages using yarn
56 ADD package.json yarn.lock /app/
57 ADD bin/yarn /app/bin/
58 RUN bundle exec bin/yarn install