-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
46 lines (38 loc) · 1.18 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
FROM ruby:3.2.2-slim-buster
# Common dependencies
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
build-essential \
gnupg2 \
curl \
less \
git \
&& apt-get clean \
&& rm -rf /var/cache/apt/archives/* \
&& 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 \
RAILS_ENV=production
# Upgrade RubyGems and install required Bundler version (see Gemfile.lock)
RUN gem update --system && \
gem install bundler:2.4.20
# Create a directory for the app code
COPY . /app
WORKDIR /app
# Native requirements
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends \
libmariadb-dev-compat libmariadb-dev \
libsqlite3-dev \
nodejs \
&& apt-get clean \
&& rm -rf /var/cache/apt/archives/* \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& truncate -s 0 /var/log/*log
RUN bundle config without development test
RUN bundle install
RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
CMD bundle exec rails server -b 0.0.0.0 -p 3000 -e production