forked from errbit/errbit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (33 loc) · 1.15 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
FROM ruby:2.3.3-alpine
LABEL maintainer="David Papp <[email protected]>"
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 clean true \
&& bundle config --global disable_shared_gems false \
&& gem update --system 2.7.4 \
&& gem install bundler --version 1.16.1 \
&& apk add --no-cache \
curl \
less \
libxml2-dev \
libxslt-dev \
nodejs \
tzdata
COPY ["Gemfile", "Gemfile.lock", "/app/"]
RUN apk add --no-cache --virtual build-dependencies \
build-base \
&& bundle config build.nokogiri --use-system-libraries \
&& bundle install \
-j "$(getconf _NPROCESSORS_ONLN)" \
--retry 5 \
--without test development no_docker \
&& apk del build-dependencies
COPY . /app
RUN RAILS_ENV=production bundle exec rake assets:precompile \
&& rm -rf /app/tmp/* \
&& chmod 777 /app/tmp
EXPOSE 8080
HEALTHCHECK CMD curl --fail "http://$(/bin/hostname -i | /usr/bin/awk '{ print $1 }'):8080/users/sign_in" || exit 1
CMD ["bundle","exec","puma","-C","config/puma.default.rb"]