-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDockerfile.production
More file actions
45 lines (36 loc) · 1.08 KB
/
Dockerfile.production
File metadata and controls
45 lines (36 loc) · 1.08 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
FROM ruby:4.0-slim
LABEL maintainer="info@energytransitionmodel.com"
RUN apt-get update -yqq && \
DEBIAN_FRONTEND=noninteractive apt-get install -yqq --no-install-recommends \
automake \
autoconf \
build-essential \
default-libmysqlclient-dev \
git \
gnupg \
graphviz \
libreadline-dev \
libxml2-dev \
libxslt1-dev \
libyaml-dev \
nodejs \
zlib1g \
zlib1g-dev
RUN gem update --system && gem install bundler
COPY Gemfile* /app/
WORKDIR /app
# Throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config frozen true \
&& bundle config jobs 4 \
&& bundle config retry 3 \
&& bundle config deployment true \
&& bundle config without 'development test' \
&& bundle install
COPY . /app/
# 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 RAILS_ENV=production DOCKER_BUILD=true bundle exec rails assets:precompile
CMD [".docker/entrypoint.sh"]