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