-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (25 loc) · 1 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
ARG RUBY_VERSION
FROM ruby:${RUBY_VERSION}
ENV LANG C.UTF-8
ENV ROOT /usr/src/app
ARG BUNDLER_VERSION
RUN apk update -qq \
# Updated and used on-the-fly and not cached locally
# See: https://github.com/gliderlabs/docker-alpine/blob/master/docs/usage.md#disabling-cache
&& apk add --no-cache build-base \
# Prevent bundler warnings `ensure that the bundler version executed is >= that which created Gemfile.lock`
&& gem update --system && gem install bundler:${BUNDLER_VERSION}
# Define working directory
WORKDIR ${ROOT}
# Install Dependencies
ADD Gemfile* $ROOT/
RUN bundler update --bundler \
&& bundle install -j "$(getconf _NPROCESSORS_ONLN)" --retry 5 \
# Remove unneeded files (cached *.gem, *.o, *.c)
&& rm -rf /usr/local/bundle/cache/*.gem \
&& find /usr/local/bundle/gems/ -name "*.c" -delete \
&& find /usr/local/bundle/gems/ -name "*.o" -delete
COPY . ${ROOT}/
# Start the main process.
EXPOSE 80
CMD ["bundle", "exec", "rackup", "config.ru", "-p", "80", "-o", "0.0.0.0"]