-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
51 lines (38 loc) · 1.07 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
50
51
FROM ubuntu:14.04
# Set ruby version.
ENV RUBY_VERSION 2.1.5
# Set app's location.
ENV APP /swaggy
# Add user dev.
RUN useradd dev
# Install dependencies.
RUN apt-get update -q && \
apt-get -qy install \
curl \
build-essential \
libxslt1-dev \
libxml2-dev \
libcurl4-openssl-dev \
libsqlite3-dev \
nodejs
# Install ruby.
RUN curl -sL http://s3.amazonaws.com/pkgr-buildpack-ruby/current/ubuntu-14.04/ruby-$RUBY_VERSION.tgz -o - | \
tar xzf - -C /usr/local && \
echo "gem: --no-document" > /usr/local/etc/gemrc
# Install bundler.
RUN gem install bundler
# Copy the Gemfile and Gemfile.lock into the image.
COPY Gemfile $APP/Gemfile
COPY Gemfile.lock $APP/Gemfile.lock
# Install ruby gems.
RUN cd $APP && bundle install --without production
# Everything up to here was cached. This includes
# the bundle install, unless the Gemfiles changed.
# Now copy the app into the image.
COPY . $APP
# Changes app's files owner.
RUN chown -R dev:dev $APP
# Set user as dev.
USER dev
# Set the final working dir to the Rails app's location.
WORKDIR $APP