-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
56 lines (46 loc) · 1.12 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
45
46
47
48
49
50
51
52
53
54
55
56
FROM ruby:3.1.2-alpine
ARG BUNDLER_VERSION
RUN apk add --update --no-cache \
binutils-gold \
build-base \
gcompat \
curl \
file \
imagemagick \
g++ \
gcc \
git \
less \
libstdc++ \
libffi-dev \
libc-dev \
linux-headers \
libxml2-dev \
libxslt-dev \
libgcrypt-dev \
make \
netcat-openbsd \
openssl \
pkgconfig \
postgresql-dev \
python3 \
tzdata
# Remove bundle config if exist
RUN rm -f .bundle/config
RUN gem install bundler:$BUNDLER_VERSION
WORKDIR /app
# Install gems
ARG BUNDLE_WITHOUT
ENV BUNDLE_WITHOUT ${BUNDLE_WITHOUT}
RUN bundle config set without ${BUNDLE_WITHOUT}
COPY . /app/
RUN bundle config build.nokogiri --use-system-libraries
RUN bundle install -j4 --retry 3 \
# Remove unneeded files (cached *.gem, *.o, *.c)
&& rm -rf /usr/local/bundle/cache/*.gem \
&& find /usr/local/bundle/gems/ -name "*.c" -delete \
&& find /usr/local/bundle/gems/ -name "*.o" -delete
# Remove folders not needed in resulting image
ARG FOLDERS_TO_REMOVE
RUN rm -rf $FOLDERS_TO_REMOVE
WORKDIR /app