-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
43 lines (32 loc) · 916 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
35
36
37
38
39
40
41
42
43
FROM public.ecr.aws/degica/rails-buildpack:2.7.7 as builder
ENV APP_HOME=/app
WORKDIR $APP_HOME
COPY Gemfile $APP_HOME/
COPY Gemfile.lock $APP_HOME/
RUN bundle config set without 'development test'
RUN MAKE="make -j $(nproc)" bundle install -j $(nproc)
FROM --platform=linux/amd64 ruby:2.7.7
ENV APP_HOME=/app
ENV PATH=$APP_HOME/bin:$PATH
WORKDIR $APP_HOME
RUN useradd --user-group --create-home app
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
file \
git \
curl \
libpq5 \
libsqlite3-0 \
libxslt1.1 \
libxml2 \
libcurl3-gnutls \
openssh-client \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir $APP_HOME/tmp \
&& mkdir $APP_HOME/log \
&& chown -R app $APP_HOME
COPY --from=builder --chown=app:app /usr/local/bundle /usr/local/bundle
ADD --chown=app:app . $APP_HOME
USER app
EXPOSE 3000
CMD ["rails", "server", "-b", "0.0.0.0"]