-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile.main
46 lines (37 loc) · 1.17 KB
/
Dockerfile.main
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 docker.io/ruby:3.2
# Needed by Ruby to process UTF8-encoded files
ENV LANG C.UTF-8
RUN sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN set -eus; \
apt-get update -qq; \
apt-get install -y --no-install-recommends \
netcat \
libpq-dev \
postgresql-client-16 \
git-all \
nodejs \
shared-mime-info \
build-essential \
libxml2-dev \
libxslt1-dev \
libjemalloc2 \
iputils-ping \
net-tools \
htop \
strace \
pg-activity ; \
apt-get clean; \
rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*;
# @see https://engineering.binti.com/jemalloc-with-ruby-and-docker/
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2
WORKDIR /app
COPY Gemfile Gemfile.lock ./
ENV RAILS_ENV="${RAIL_ENV:-"production"}"
RUN gem update --system -N
RUN gem install bundler -N --version 1.17.3
RUN bundle install -j 12 --deployment --without "test development"
COPY . /app
RUN SECRET_KEY_BASE=1 bundle exec rake assets:precompile
EXPOSE 3000
CMD "./entrypoint.sh"