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