-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.production
46 lines (36 loc) · 1.06 KB
/
Dockerfile.production
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
FROM ruby:3.3.5-slim
RUN apt-get update -qq && apt-get install -yq --no-install-recommends \
build-essential \
gnupg \
libreadline-dev \
libxml2-dev \
default-libmysqlclient-dev \
libpq-dev \
libxslt1-dev \
libyaml-dev \
nodejs \
zlib1g \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
ENV LANG=C.UTF-8 \
BUNDLE_JOBS=4 \
BUNDLE_RETRY=3 \
RAILS_ENV=production \
DOCKER_BUILD=true
RUN gem update --system && gem install bundler
WORKDIR /usr/src/app
COPY Gemfile* ./
RUN bundle config frozen true \
&& bundle config jobs 4 \
&& bundle config deployment true \
&& bundle config without 'development test' \
&& bundle install
COPY . .
# Precompile assets
# SECRET_KEY_BASE or RAILS_MASTER_KEY is required in production, but we don't
# want real secrets in the image or image history. The real secret is passed in
# at run time
ARG SECRET_KEY_BASE=fakekeyforassets
RUN bundle exec rails assets:clobber && bundle exec rails assets:precompile
EXPOSE 3000
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]