-
Notifications
You must be signed in to change notification settings - Fork 41
/
Dockerfile.dev
33 lines (24 loc) · 1.12 KB
/
Dockerfile.dev
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
FROM ruby:2.7-slim-buster
WORKDIR /rails_app
RUN apt-get update && apt-get -y upgrade && \
apt-get install --no-install-recommends -y \
build-essential \
# git is required for installing gems from git repos
git \
libpq-dev \
# debian buster and comes with pg client v11 by default
postgresql-client-11 \
tmpreaper
# set MRI memory allocator to mimic jemalloc memory savings
ENV MALLOC_ARENA_MAX=2
ADD ./Gemfile /rails_app/
ADD ./Gemfile.lock /rails_app/
RUN bundle config --global jobs `cat /proc/cpuinfo | grep processor | wc -l | xargs -I % expr % - 1`
# run `gem update system` so installation of mini_racer does not fail
# See troubleshooting for mini_racer and supported ruby versions: https://github.com/rubyjs/mini_racer?tab=readme-ov-file#supported-ruby-versions--troubleshooting
# pinning gem update to 3.4.22 since anything higher requires updating Ruby version to 3+
RUN gem i "rubygems-update:~>3.4.22" --no-document && update_rubygems
RUN bundle install
ADD ./ /rails_app
RUN (cd /rails_app && mkdir -p tmp/pids && rm -f tmp/pids/*.pid)
CMD ["/rails_app/scripts/docker/start.sh"]