-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
57 lines (49 loc) · 1.45 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
57
FROM ruby:2.7.0-alpine AS builder
ARG RAILS_MASTER_KEY
WORKDIR /app
RUN apk add --update --no-cache \
build-base \
mariadb-dev \
git \
imagemagick \
ffmpeg \
icu-dev \
tzdata \
nodejs \
bash
#Cache bundle install
ADD Gemfile* /app/
RUN bundle config --global frozen 1 \
&& gem install bundler -v 2.2.3 && gem install rake -v 12.3.3 \
&& bundle install -j4 --retry 3 \
&& rm -rf /usr/local/bundle/cache/*.gem \
&& find /usr/local/bundle/gems/ -name "*.c" -delete \
&& find /usr/local/bundle/gems/ -name "*.o" -delete
ADD . /app
# RUN bundle exec rails assets:precompile
# RUN rm -rf node_modules tmp/cache app/assets vendor/assets lib/assets spec
FROM madnight/docker-alpine-wkhtmltopdf as wkhtmltopdf
FROM ruby:2.7.0-alpine
LABEL maintainer="[email protected]"
RUN apk add --update --no-cache \
mariadb-dev \
imagemagick \
icu-dev \
tzdata \
ffmpeg \
nodejs \
bash
# libcrypto1.0 libssl1.0 \
# ttf-dejavu ttf-droid ttf-freefont ttf-liberation ttf-ubuntu-font-family \
ENV LANG C.UTF-8
ENV APP_ROOT /app
ENV RAILS_LOG_TO_STDOUT true
ENV RAILS_SERVE_STATIC_FILES true
WORKDIR $APP_ROOT
COPY --from=wkhtmltopdf /bin/wkhtmltopdf /bin/
COPY --from=builder /usr/local/bundle /usr/local/bundle
COPY --from=builder $APP_ROOT $APP_ROOT
RUN gem install bundler -v 2.2.3 && gem install rake -v 12.3.3
RUN date -u > BUILD_TIME
EXPOSE 3000
CMD ["rails", "server", "-b", "0.0.0.0", "-e", "production"]