-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (25 loc) · 913 Bytes
/
Copy pathDockerfile
File metadata and controls
34 lines (25 loc) · 913 Bytes
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
FROM docker.io/library/ruby:4.0.5-slim-bookworm
ARG APP_UID=1000
ARG APP_GID=1000
ENV APP_HOME=/app \
BUNDLE_APP_CONFIG=/app/tmp/bundle \
BUNDLE_WITHOUT=development:test \
HOME=/app/tmp \
PORT=9293 \
RACK_ENV=production \
TMPDIR=/app/tmp
WORKDIR ${APP_HOME}
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential ca-certificates libsqlite3-0 pkg-config \
&& groupadd --gid "${APP_GID}" app \
&& useradd --uid "${APP_UID}" --gid app --home-dir "${APP_HOME}" --shell /usr/sbin/nologin app \
&& rm -rf /var/lib/apt/lists/*
COPY Gemfile Gemfile.lock ./
RUN bundle config set without "${BUNDLE_WITHOUT}" \
&& bundle install --jobs=4 --retry=3
COPY . .
RUN mkdir -p db log tmp \
&& chown -R app:app db log tmp
EXPOSE 9293
USER app:app
CMD ["bundle", "exec", "rackup", "--host", "0.0.0.0", "--port", "9293", "--option", "Threads=0:8"]