-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
34 lines (24 loc) · 819 Bytes
/
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
FROM ruby:3.1.2-slim-bullseye as build
WORKDIR /usr/src/app
COPY Gemfile /usr/src/app/
COPY Gemfile.lock /usr/src/app/
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential \
&& bundle config set frozen true \
&& bundle config set with production \
&& bundle install --no-cache
FROM ruby:3.1.2-slim-bullseye as runtime
LABEL maintainer="nownabe <[email protected]>"
EXPOSE 8080
ENV PORT 8080
RUN apt-get update \
&& apt-get install -y --no-install-recommends nasm \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& groupadd -g 61000 app \
&& useradd -g 61000 -l -M -s /bin/false -u 61000 app
USER app
WORKDIR /usr/src/app
COPY --from=build --chown=app:app /usr/local/bundle /usr/local/bundle
COPY . /usr/src/app
CMD bundle exec puma -e production -p $PORT