-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
48 lines (41 loc) · 1.09 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
# Copyright 2019 Adevinta
ARG rails_env=production
FROM ruby:3.3.0-alpine AS pre-builder
ARG build_without=""
ENV SECRET_KEY_BASE=dumb
RUN apk add --update --no-cache \
openssl \
tar \
build-base \
tzdata \
postgresql-dev \
postgresql-client \
sqlite-dev \
&& mkdir -p /var/app
ENV BUNDLE_PATH="/gems" BUNDLE_JOBS=2 RAILS_ENV=${rails_env} BUNDLE_WITHOUT=${bundle_without}
WORKDIR /var/app
COPY Gemfile* /var/app/
RUN bundle install -j4 --retry 3 \
&& rm -rf /gems/cache/* \
&& find /gems/ -name "*.c" -delete \
&& find /gems/ -name "*.o" -delete
FROM ruby:3.3.0-alpine
ARG rails_env=production
RUN apk add --update --no-cache \
openssl \
tzdata \
postgresql-dev \
sqlite-dev \
postgresql-client \
gettext \
ca-certificates
ARG BUILD_RFC3339="1970-01-01T00:00:00Z"
ARG COMMIT="local"
ENV BUILD_RFC3339 "$BUILD_RFC3339"
ENV COMMIT "$COMMIT"
COPY --from=pre-builder /gems/ /gems/
ENV BUNDLE_PATH="/gems" BUNDLE_JOBS=2 RAILS_ENV=${rails_env} BUNDLE_WITHOUT=${bundle_without}
ENV RAILS_LOG_TO_STDOUT true
WORKDIR /app
COPY . .
CMD ["./run.sh"]