-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathDockerfile.govuk-base
More file actions
43 lines (36 loc) · 1.75 KB
/
Dockerfile.govuk-base
File metadata and controls
43 lines (36 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Standard Dockerfile for GOV.UK projects. Random project-specific stuff should *not*
# go in this file. Instead, you should copy this file into the directory for the
# project and make any changes to it there.
# Install packages for building ruby
FROM buildpack-deps:trixie
# Install chromium browser and its webdriver
RUN apt-get update -qq && \
apt-get install -y --no-install-recommends \
build-essential \
autoconf bison \
libssl-dev \
libreadline-dev \
zlib1g-dev \
chromium chromium-driver && \
rm -rf /var/lib/apt/lists/*
# Enable no-sandbox for chrome so that it can run as a root user
ENV GOVUK_TEST_CHROME_NO_SANDBOX 1
# Install node / yarn
RUN curl -sL https://deb.nodesource.com/setup_22.x | bash -
RUN mkdir -p /etc/apt/keyrings && \
curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor -o /etc/apt/keyrings/yarn-archive-keyring.gpg && \
chmod a+r /etc/apt/keyrings/yarn-archive-keyring.gpg
RUN echo "deb [signed-by=/etc/apt/keyrings/yarn-archive-keyring.gpg] https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update -qq && apt-get install -y yarn nodejs
RUN yarn config set cache-folder /root/.yarn/
# Install rbenv to manage ruby versions
RUN git clone https://github.com/rbenv/rbenv.git /rbenv
RUN git clone https://github.com/rbenv/ruby-build.git /rbenv/plugins/ruby-build
RUN /rbenv/plugins/ruby-build/install.sh
ENV PATH /root/.rbenv/shims:/rbenv/bin:$PATH
ENV BUNDLE_SILENCE_ROOT_WARNING 1
# Automatically run `bundle install` when gems are missing
ENV BUNDLE_AUTO_INSTALL 1
# Install `psql` and `mysql` for 'rails dbconsole'
# and `less` for paginated output in 'rails console' and 'binding.pry'
RUN apt-get update -qq && apt-get install -y postgresql-client default-mysql-client less