-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.prod
33 lines (25 loc) · 900 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
FROM ruby@sha256:2f6585f9a836ef254ff4cdcd5d2ad51cc7718d4f71b1bdf899408f61012cea4f
LABEL maintainer="[email protected]"
ENV HOME /home/user
ENV CODE /code
ENV RAILS_ENV production
ENV RAILS_SERVE_STATIC_FILES true
ENV RAILS_LOG_TO_STDOUT true
ENV EDITOR vim
RUN useradd --create-home --home-dir "$HOME" user && \
chown -R user:user "$HOME" && \
chown -R user:user "$GEM_HOME"
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential=12.9 vim=2:8.2.2434-3 rsync=3.2.3-4+deb11u1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
USER user
WORKDIR $CODE
RUN gem install bundler:2.2.29
COPY --chown=user:user Gemfile* ./
RUN bundle config --global frozen 1
RUN bundle config set --local without 'development test'
RUN bundle install
COPY --chown=user:user . .
EXPOSE 3000
CMD ["bundle","exec","rails","server","-u","puma","-p","3000","-b","0.0.0.0"]