]> git.openstreetmap.org Git - rails.git/blob - Dockerfile
Merge remote-tracking branch 'upstream/pull/4458'
[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       libyaml-dev \
23       locales \
24       postgresql-client \
25       ruby \
26       ruby-dev \
27       ruby-bundler \
28       software-properties-common \
29       tzdata \
30       unzip \
31       nodejs \
32       npm \
33  && npm install --global yarn \
34  # We can't use snap packages for firefox inside a container, so we need to get firefox+geckodriver elsewhere
35  && add-apt-repository -y ppa:mozillateam/ppa \
36  && echo "Package: *\nPin: release o=LP-PPA-mozillateam\nPin-Priority: 1001" > /etc/apt/preferences.d/mozilla-firefox \
37  && apt-get install --no-install-recommends -y \
38       firefox-geckodriver \
39  && apt-get clean \
40  && rm -rf /var/lib/apt/lists/*
41
42 # Install compatible Osmosis to help users import sample data in a new instance
43 RUN curl -OL https://github.com/openstreetmap/osmosis/releases/download/0.47.2/osmosis-0.47.2.tgz \
44  && tar -C /usr/local -xzf osmosis-0.47.2.tgz
45
46 ENV DEBIAN_FRONTEND=dialog
47
48 # Setup app location
49 RUN mkdir -p /app
50 WORKDIR /app
51
52 # Install Ruby packages
53 ADD Gemfile Gemfile.lock /app/
54 RUN bundle install
55
56 # Install NodeJS packages using yarn
57 ADD package.json yarn.lock /app/
58 ADD bin/yarn /app/bin/
59 RUN bundle exec bin/yarn install