-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
44 lines (32 loc) · 1.07 KB
/
Dockerfile
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
44
FROM ruby:3.2.2
# Match our Bundler version
RUN gem install bundler -v 2.3.26
# Update the system
RUN apt-get update -y
# Install Chromium for the feature tests
RUN apt-get install -y --no-install-recommends chromium
# Install Poppler to generate PDF previews
RUN apt-get install -y --no-install-recommends poppler-utils
## Install gems in a separate Docker fs layer
WORKDIR /gems
COPY Gemfile Gemfile.lock ./
RUN bundle
## Node
ARG NODE_MAJOR=18
RUN curl -fsSL https://deb.nodesource.com/setup_$NODE_MAJOR.x | bash -
RUN apt-get install -y nodejs
## Yarn
RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install yarn
## Install yarn dependencies in a separate Docker fs layer
WORKDIR /js
COPY package.json yarn.lock ./
RUN yarn install
WORKDIR /app
RUN groupadd -r app && \
useradd --no-log-init -r -g app -d /app app
USER app:app
COPY . .
# Sets an interactive shell as default command when the container starts
CMD ["/bin/sh"]