-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.prod
41 lines (31 loc) · 832 Bytes
/
Dockerfile.prod
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
FROM ruby:3.3-slim
ARG uid=1337
ARG user=killerbuchhalter
ARG gid=1337
ARG usergroup=killerbuchhaltergroup
ENV LC_ALL=C.UTF-8
ENV LANG=en_US.UTF-8
ENV WORKDIR=/app
WORKDIR ${WORKDIR}
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y --no-install-recommends \
build-essential \
libjemalloc2 \
libpq-dev \
netbase \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN groupadd --gid $gid $usergroup \
&& useradd --uid $uid --gid $uid -m $user
COPY --chown=$uid:$gid Gemfile* ${WORKDIR}/
RUN bundle config set deployment 'true'
# RUN bundle config set without 'development test'
RUN bundle install -j4
COPY --chown=$uid:$gid . .
RUN rm -rf test .vscode .github .devcontainer
USER $user
ENV RUBY_YJIT_ENABLE=true
ENV RACK_ENV=production
CMD bundle exec rackup -o0