-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathDockerfile
43 lines (36 loc) · 1023 Bytes
/
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
FROM ruby:3.1-alpine
RUN apk update && apk add --update --no-cache \
# C compiler etc
build-base \
# System specs
chromium \
chromium-chromedriver \
# Support git sources in the Gemfile
git \
# Used by ActiveStorage
imagemagick \
# Dependencies for Nokogiri
libxml2-dev \
libxslt-dev \
# Webpacker and friends
nodejs nodejs-npm \
# Timezone data for Ruby's TZInfo library
tzdata \
# Used by the pg gem
postgresql-dev
RUN bundle config build.nokogiri --use-system-libraries
WORKDIR /app
# Install JS dependencies before copying app code to use layer caching.
# Note: In JS heavy apps consider an approach similar to bundler.
COPY package.json ./
RUN npm install
COPY . .
# We use a custom script as entry point to manage our bundle cache
COPY ./docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
# Setup environment for cached bundle
ENV BUNDLE_PATH=/gems \
BUNDLE_BIN=/gems/bin \
GEM_HOME=/gems
ENV PATH="${BUNDLE_BIN}:${PATH}"