This repository was archived by the owner on Mar 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathDockerfile.prod
More file actions
58 lines (44 loc) · 1.46 KB
/
Dockerfile.prod
File metadata and controls
58 lines (44 loc) · 1.46 KB
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
58
# https://github.com/lewagon/rails-base-chrome-imagemagick/tree/dev
FROM quay.io/lewagon/rails-base-chrome-imagemagick:dev
ARG BUNDLER_VERSION
ENV BUNDLER_VERSION=${BUNDLER_VERSION:-2.1.4}
COPY ./Aptfile /tmp/Aptfile
RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get -yq dist-upgrade && \
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
$(cat /tmp/Aptfile | xargs) && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
truncate -s 0 /var/log/*log
# Configure bundler
ENV LANG=C.UTF-8 \
BUNDLE_JOBS=4 \
BUNDLE_RETRY=3
ENV PATH /app/bin:$PATH
WORKDIR /app
COPY Gemfile Gemfile.lock package.json yarn.lock ./
# Upgrade RubyGems and install required Bundler version
RUN gem update --system && \
gem install bundler:$BUNDLER_VERSION && \
bundle config set deployment 'true' && \
bundle config set without 'development test' && \
bundle install
COPY app/ ./app
COPY bin/ ./bin
COPY config/ ./config
COPY lib/ ./lib
COPY db/ ./db
COPY public/ ./public
COPY config.ru Rakefile postcss.config.js babel.config.js ./
RUN mkdir log
ENV RAILS_ENV=production
ENV NODE_ENV=production
# Hack to not leak the master_key for build
# https://github.com/rails/rails/issues/32947#issuecomment-531508722
ENV ASSETS_PRECOMPILE=1
ENV SECRET_KEY_BASE=1
RUN rails assets:precompile
ENV RAILS_LOG_TO_STDOUT=enabled
ENV RAILS_SERVE_STATIC_FILES=enabled
# cleanup
RUN rm -rf node_modules tmp/cache vendor/assets test
EXPOSE 3000