]> git.openstreetmap.org Git - rails.git/blob - Dockerfile
Merge remote-tracking branch 'upstream/pull/6504'
[rails.git] / Dockerfile
1 ARG RUBY_VERSION=3.2
2 FROM ruby:$RUBY_VERSION-bookworm
3
4 ENV DEBIAN_FRONTEND=noninteractive
5
6 # Install system packages then clean up to minimize image size
7 RUN apt-get update \
8   && apt-get install --no-install-recommends -y \
9     build-essential \
10     curl \
11     default-jre-headless \
12     file \
13     git-core \
14     gpg-agent \
15     libarchive-dev \
16     libffi-dev \
17     libgd-dev \
18     libpq-dev \
19     libsasl2-dev \
20     libvips-dev \
21     libxml2-dev \
22     libxslt1-dev \
23     libyaml-dev \
24     locales \
25     postgresql-client \
26     tzdata \
27     unzip \
28     nodejs \
29     npm \
30     osmosis \
31     ca-certificates \
32     firefox-esr \
33     xvfb \
34     mesa-utils \
35     libgl1-mesa-dri \
36   && apt-get clean \
37   && rm -rf /var/lib/apt/lists/* # Replace with `apt-get dist-clean` after upgrading to Debian 13 (Trixie)
38
39 # Install yarn globally
40 RUN npm install --global yarn
41
42 ENV DEBIAN_FRONTEND=dialog
43
44 # Setup app location
45 RUN mkdir -p /app
46 WORKDIR /app
47
48 # Install Ruby packages
49 COPY Gemfile Gemfile.lock /app/
50 RUN bundle install
51
52 # Install NodeJS packages using yarn
53 COPY package.json yarn.lock /app/
54 COPY bin/yarn /app/bin/
55 RUN bundle exec bin/yarn install
56
57 # Copy and set entrypoint
58 COPY docker/entrypoint.sh /entrypoint.sh
59 RUN chmod +x /entrypoint.sh
60
61 ENTRYPOINT ["/entrypoint.sh"]