-
Notifications
You must be signed in to change notification settings - Fork 56
/
Dockerfile
47 lines (44 loc) · 1.04 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
# Use the the official Ruby image as a base
FROM ruby:3.3-alpine
# Install runtime dependencies
# Node.js is used for JavaScript compression via the uglifier gem
RUN set -eux; \
apk add --no-cache \
dumb-init \
nodejs \
tzdata \
;
WORKDIR /voctoweb
# Install required gems
ENV BUNDLE_FORCE_RUBY_PLATFORM 1
ENV BUNDLE_WITHOUT "development:test:doc"
ENV MAKEFLAGS "-j$(nproc)"
COPY Gemfile Gemfile.lock /voctoweb/
RUN set -eux; \
apk add curl; \
apk add --no-cache --virtual .build-deps \
g++ \
git \
gcc \
libxml2-dev \
libxslt-dev \
make \
musl-dev \
patch \
postgresql-dev \
build-base \
; \
\
bundle config set --local with development \
gem install -v 2.5.20 bundler; \
bundle install --jobs=$(nproc); \
rm -r ~/.bundle; \
\
runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/bundle/gems \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --virtual .voctoweb-rundeps $runDeps; \
apk del .build-deps