forked from errbit/errbit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (35 loc) · 1.3 KB
/
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
44
45
46
47
48
49
FROM ruby:3.1.6-alpine
ENV RUBYGEMS_VERSION=3.5.23
ENV BUNDLER_VERSION=2.5.23
WORKDIR /app
# throw errors if Gemfile has been modified since Gemfile.lock
RUN echo "gem: --no-document" >> /etc/gemrc \
&& bundle config --global frozen 1 \
&& bundle config --global disable_shared_gems false \
&& gem update --system "$RUBYGEMS_VERSION" \
&& gem install bundler --version "$BUNDLER_VERSION" \
&& apk add --no-cache \
curl \
less \
libxml2-dev \
libxslt-dev \
nodejs \
tzdata
COPY [".ruby-version", "Gemfile", "Gemfile.lock", "/app/"]
COPY ["vendor/", "/app/vendor/"]
RUN apk add --no-cache --virtual build-dependencies build-base \
&& bundle config build.nokogiri --use-system-libraries \
&& bundle config set without 'test development no_docker' \
&& bundle install -j "$(getconf _NPROCESSORS_ONLN)" --retry 5 \
&& bundle clean --force \
&& apk del build-dependencies
COPY . /app
RUN RAILS_ENV=production bundle exec rake assets:precompile \
&& rm -rf /app/tmp/* \
&& chmod 777 /app/tmp
ENV RAILS_ENV=production
ENV RAILS_LOG_TO_STDOUT=true
ENV RAILS_SERVE_STATIC_FILES=true
EXPOSE 3000/tcp
HEALTHCHECK CMD curl --fail "http://$(/bin/hostname -i | /usr/bin/awk '{ print $1 }'):${PORT:-3000}/users/sign_in" || exit 1
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]