2016-02-06 15:52:23 +01:00
|
|
|
# Based on ruby image, packed with a lot of development dependencies
|
|
|
|
FROM ruby:2.3
|
2015-04-26 15:20:05 +02:00
|
|
|
|
2016-02-06 15:52:23 +01:00
|
|
|
# Install all dependencies for development and testing
|
2015-04-26 15:20:05 +02:00
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install --no-install-recommends -y \
|
|
|
|
mysql-client \
|
|
|
|
libv8-dev \
|
2016-10-14 18:08:01 +02:00
|
|
|
libmagic-dev \
|
2015-04-26 15:20:05 +02:00
|
|
|
libmysqlclient-dev \
|
|
|
|
xvfb \
|
|
|
|
iceweasel && \
|
|
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
|
|
apt-get clean
|
|
|
|
|
2016-02-06 15:52:23 +01:00
|
|
|
# Run app and all commands as user 'app'. This avoids changing permissions
|
|
|
|
# for files in mounted volume.
|
|
|
|
RUN adduser --gecos GECOS --disabled-password --shell /bin/bash app
|
|
|
|
USER app
|
2015-04-26 15:20:05 +02:00
|
|
|
|
2016-02-06 15:52:23 +01:00
|
|
|
# Create an directory to store the application code.
|
|
|
|
RUN mkdir /home/app/src
|
|
|
|
WORKDIR /home/app/src
|
2015-04-26 15:20:05 +02:00
|
|
|
|
|
|
|
# Copy plugins before the rest to allow bundler loading gemspecs
|
|
|
|
# TODO: Move plugins to gems and add them to Gemfile instead
|
2016-02-06 15:52:23 +01:00
|
|
|
COPY plugins ./plugins
|
2015-04-26 15:20:05 +02:00
|
|
|
|
2016-02-06 15:52:23 +01:00
|
|
|
# Add Gemfiles and run bundle.
|
|
|
|
COPY Gemfile Gemfile.lock ./
|
|
|
|
ENV BUNDLE_JOBS=4 BUNDLE_PATH=/home/app/bundle \
|
|
|
|
BUNDLE_APP_CONFIG=/home/app/bundle/config
|
|
|
|
RUN bundle install
|
2015-04-26 15:20:05 +02:00
|
|
|
|
2016-02-06 15:52:23 +01:00
|
|
|
# Copy the application code. (Excluded files see .dockerignore)
|
|
|
|
COPY . ./
|
2015-04-26 15:20:05 +02:00
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
2015-05-15 20:23:53 +02:00
|
|
|
CMD ["rails", "server", "--binding", "0.0.0.0"]
|